I have a large data set, roughly 7000 lines. this has been generated with a particular piece missing. Is there a way I can on mass add in the missing information? Below is an example line from my dataset,
PRIPOS;20150527;EUR;AAAAA;Maxi Dresses;5050300000000;22200000;Thyme;Thyme;6;32;AAAAAA MAXI DRESS;AAAAAA MAXI DRESS;2;All AAAAA Products;000;Dresses;100;Maxi Dresses;10000;Soft Maxi Dress;000.00;00.00;;;;;SS15;;;Insert;;
The first bold field (32) need to be considered the second bold field (insert) is where data needs to be added. The 32 represents a size and the Insert should represent a different size. file contains around 7k lines, all different information.
Is there a particular text editor that will allow me to use a wildcard on a replace function, or an ideas on a script? Failing this I would assume dumping into a SQL table and updating via query would be the quickest method?
Thanks a lot.
You could load into Excel and do a formula on the insert column that looks at the 11th column and based on that sets it's value. Set your list separator character to a semi-colon in the regional settings first.
Related
Queries using contains have recently stopped working correctly.
When value in source data column is 1,2,3 and the query is WHERE B contains '3'
See test sheet here:
https://docs.google.com/spreadsheets/d/1tCJBerHOmVfKbtb81JEyWEp6ZYP0EXyJqG-_7zVWpLw/edit?usp=sharing
Update
It appears that google is now first applying the Number Formatting to the cell then running the QUERY. Ensure your data column is set to PLAIN TEXT.
In your example, add say z (any text) into B7 and John should appear in the output of your query.
As per the Update Google has changed to now first run the "Number Format" filters, then the QUERY method runs on the field.
So by default AUTOMATIC NUMBER formatting is applied - google based on the value sets the format on what it thinks is correct.
FIX: Set data to FORMAT > NUMBER > PLAIN TEXT
I have updated the example to illustrate this.
This change would probably assist the general Google Sheets user, but where you are working off raw data ensure you set the PLAIN TEXT number format on the columns.
I have a csv file and I need to delete all even lines (example: line 2, line 4, line 6 ecc.). They are over 7000. It's possible to do with a single command or function in Libreoffice Calc?
For example, if the data is in column A, then enter this formula in B1 and fill down.
=INDIRECT(ADDRESS(ROW()*2-1;1))
Excellent A (as usual) from #JimK but might not adapt too well if the rows to be deleted contain data in many columns. So though not a single command or function (more a process that should at least achieve the result, if not in the preferred way):
Fill as much of a (spare) column as required with:
=ISODD(ROW())
then filter to select FALSEs and delete these rows. The helper column may then also be deleted.
I'm trying to merge multiple JSON data sets into one large data set, due to a max limit of 100 on the server I'm pulling them from.
The easiest way to do this would be to eliminate the end of one set and the beginning of the next and replace it with "," so that there would be only one open and close to the entire large set. This is what appears between the last entry of one set and the first entry of the next currently:
],"version":"1.0"}{"error":"OK","limit":100,"offset":100,"number_of_page_results":100,
"number_of_total_results":20235,"status_code":1,"results":[
Again, I need that entire string replaced with just a comma, but the problem I'm encountering is that I had to change the offset between each data set to grab the next 100 entries, so the "offset":100, is different in each string ("offset":200, "offset":300, etc.). I can't seem to get wildcards to cooperate. I suspect it has something to do with all the brackets that are already in the string.
Any help would be appreciated. Thank you.
A regular expression that matches the whole input you provided (provided there's no new line characters) is:
\],"version":"1\.0"\}\{"error":"OK","limit":[0-9]+,"offset":[0-9]+,"number_of_page_results":[0-9]+,"number_of_total_results":[0-9]+,"status_code":[0-9]+,"results":\[
It will get any digits in place off all the numbers in your sample (except version).
I have imported a csv file from MySQL, documenting part numbers and descriptions. Some of these part numbers have values like 1234567890987654321, which is then shortened by excel to 1.23e18. Problem is, I cannot query a part with this formatted data.
Now I cannot feasibly go through every cell as there are just over 28000 of them. I have converted the row to text however this does not change the data in the cell.
The closest thing I have to a solution is deleting the cells and then undo-ing, which gets the number in a textual format but then gives me a 'number in text field' error.
Also some parts have part numbers like 12E345 which is then changed to 1200000000000000000000000000000000000000000000- you get the picture.
Very annoying...
I would like a batch process to change all the values to text format, thanks in advance.
Instead of just opening the CSV in Excel, import it with Data -> External Sources -> From Text.
You will have to first pick basic things like "delimited" format, whether first row contains headers, separator etc.
In the third part of the "Text Import wizard", you can pick data type of each column - picking Text for your columns will probably solve the problem.
I am reading contents of a file and adding it as a row in mysql db. The column in which the file contens will be added is a TEXT column.
There are multiple files that will be uploaded and it's contents are extracted in a cronjob and added to the TEXT column. One row per file.
My files sometimes are empty. In that case, a row with no content is created.
Now, I need to retrieve this content in another cronjob and perform some activities. I would like to filter and retrieve only those rows where content exists. Like using where clause with LENGTH(TRIM(ContentCol)) > 0. Since it is a TEXT column, I am unable to use LENGTH & TRIM functions.
Also when I use LENGTH function, it show different length.. I could see 5, 1 etc. though there is no value in the row-cell.
How can I perform this criteria?
Well I use the function BIT_LENGTH(string); but only with short text data.
This function only return the length of bits, I evaluate this like
BIT_LENGTH(string) > 0