CSV Standard File Format

Information related to the use of iMacros for form filling and data upload.

Moderator: iMacros Moderators

CSV Standard File Format

by Tech Support on Fri Dec 09, 2005 4:31 pm

The CSV ("Comma Separated Values") file format is often used to exchange data between differently similar applications. The CSV file format is useable by Internet Macros, Microsoft Excel and many other applications.

The CSV Format:

1. Each record is one line - Line separator may be LF (0x0A) or CRLF (0x0D0A), a line seperator may also be embedded in the data (making a record more than one line but still acceptable).

2. Fields are separated with commas.

3. Leading and trailing whitespace is ignored - Unless the field is delimited with double-quotes in that case the whitespace is preserved.

4. Embedded commas - Field must be delimited with double-quotes.

5. Embedded double-quotes - Embedded double-quote characters must be doubled, and the field must be delimited with double-quotes.

6. Embedded line-breaks - Fields must be surounded by double-quotes.

7. Always Delimiting - Fields may always be delimited with double quotes, the delimiters will be parsed and discarded by the reading applications.

Here are some examples that demonstrate the rules above. Each sample describes the data and how the reading application should interpret it.

Standard line:
Code: Select all
AAA, BBB, CCC


Leading and trailing whitespace and embedded commas
Code: Select all
"  AAA ", "B,B,B", "   CCC,,,"
User avatar
Tech Support
 
Posts: 5003
Joined: Tue Sep 20, 2005 12:25 pm

Inputting data from Excel

by sdtony on Mon Dec 12, 2005 11:29 pm

Looking at the csv explaination, should I convert all excel data into csv if I plan on using it in a macro? I'd like to create a macro that copies a cell value and pastes it into an online form (requires loging into a website). I'd like to then run the report (clicking the search button on the web page). I need to do this for approx 26,000 cells one after the other. How should I do this?
sdtony
 
Posts: 31
Joined: Mon Dec 12, 2005 11:15 pm

by Tech Support on Tue Dec 13, 2005 2:50 pm

Excel will do all the conversion for you: Just select SAVE AS and use "CSV" as file format :)
User avatar
Tech Support
 
Posts: 5003
Joined: Tue Sep 20, 2005 12:25 pm

by sdtony on Tue Dec 13, 2005 5:20 pm

how would i get the data into the macro?
sdtony
 
Posts: 31
Joined: Mon Dec 12, 2005 11:15 pm

by Tech Support on Wed Dec 14, 2005 6:57 am

User avatar
Tech Support
 
Posts: 5003
Joined: Tue Sep 20, 2005 12:25 pm

by ender on Tue Jun 12, 2007 1:05 am

I'm banging my head on the wall !!

I have Excell 2002 and it uses ";" instead of "," for separating the colums
I've tried to set it from the sistem "international options .." but can't get it.

I have to edit the file manually with notepad to change ";" into ","

anybody can help?

ciao e grazie
ender
 
Posts: 3
Joined: Tue Jun 12, 2007 12:54 am

by ender on Tue Jun 19, 2007 9:06 am

Sorry, but my problem is something else

when I save the .csv file, instead of simple "," i get ";" that imacros does not recognize

I know this is an excell problem, but maybe someone knows how to get around it


tx
ender
 
Posts: 3
Joined: Tue Jun 12, 2007 12:54 am

by Tech Support on Wed Jun 20, 2007 3:40 pm

In the USA and some other countries, for example the United Kingdom, Windows uses a dot (.) as decimal delimiter. For example, 0.5 = 1/2. In these countries, the data entries in a CSV file are separated by commas (,).

In continental Europe and some countries elsewhere Windows uses a comma (,) as decimal delimiter. For example, 0,5 = 1/2. In these countries, the data entries in a CSV file are separated by semi-colons ( ; ).

You can switch between ; and , by going to
Start > Control Panel > Regional and Language Options > Standards and formats drop down. You can change the country there. For ; as CSV separator select (for example) USA and for , as separator select (for Example) Germany.
User avatar
Tech Support
 
Posts: 5003
Joined: Tue Sep 20, 2005 12:25 pm

possible workaround

by ctrpapa on Fri Feb 01, 2008 7:31 pm

maybe your actual data contains ; in it but if it doesn't you can always open up the csv file in a text editor (notepad, vim) and do a find and replace

hopefully you find the right setting in excel though
ctrpapa
 
Posts: 2
Joined: Fri Feb 01, 2008 5:04 pm

Re: CSV Standard File Format

by gmatch on Sun Jan 18, 2009 8:16 pm

Quote:
5. Embedded double-quotes - Embedded double-quote characters must be doubled, and the field must be delimited with double-quotes.

I'm not finding this to work. What's the current solution when a field has quotes/commas both inside it? Here's an example of what I can't get into 1 field:

Couple words ending in a comma, "sentence with quotes around it".

I've tried but failed with:

"Couple words ending in a comma, "sentence with quotes around it"."
""Couple words ending in a comma, "sentence with quotes around it".""
""Couple words ending in a comma, ""sentence with quotes around it"".""
"Couple words ending in a comma, ""sentence with quotes around it""."
gmatch
 
Posts: 11
Joined: Sun Jan 18, 2009 7:29 pm

Re: CSV Standard File Format

by Marlon on Wed Mar 18, 2009 8:38 am

I am having the same problem with entries in my csv file. For example, in a specific spreadsheet cell, I have the string: cats and "hot dogs". What modifications do I do to the actual spreadsheet cell? When doing the form-filling with a CONTENT={{!COL3}}, I get "cats and" as the value. I've tried (similar to the above author):

"cats and ""hot dogs"""
cats and ""hot dogs""

Thank you and looking forward to a response.
Marlon
 
Posts: 9
Joined: Tue Nov 20, 2007 1:27 pm

Re: CSV Standard File Format

by Valeo on Fri Nov 20, 2009 3:45 am

Hello,
I have 2 questions :
1> My file.CSV have the connexion parameters
login1,pwd1
login2,pwd2
login3,pwd3
login4,pwd4
My imaros works (It goes to the website et loads some documents) when i give the value of DATASOURCE_LINE
By SET !DATASOURCE_LINE 1 or 2 or 3 or 4
How can i do if one day the users change le number (add more login ou delete 1) of login and password ?
2> I have to test on a website if one links exists, If it exists, the macro continues, else goto the next step. Can you tell me if your tools imacro can do it ?

Thanks you for your answer.
Valeo
 
Posts: 0
Joined: Thu Nov 19, 2009 6:43 am


Return to How-To's and Examples for Form Filling

Who is online

Users browsing this forum: No registered users and 1 guest

-->