Form Filling from CSV with Line Breaks
Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
Form Filling from CSV with Line Breaks
Is it possible to include line breaks when inputting from a CSV file? I've tried everything but it seems to truncate the line breaks.
- JamesBassdrop
- Posts: 7
- Joined: Sun Jul 29, 2018 8:51 pm
- Location: Canada
- Contact:
Re: Form Filling from CSV with Line Breaks
Hey macrohelp,macrohelp wrote:Is it possible to include line breaks when inputting from a CSV file? I've tried everything but it seems to truncate the line breaks.
Similar to how spaces need to be replaced with <SP>, to include line breaks you'll likely need to replace \r\n, \r, and \n with <BR>:
\r = carriage return
\n = line feed
\r\n = often used in preference to \n as it displays properly on both Windows and Unix/Linux
To avoid the possibility of ending up with duplicate line breaks, \r\n needs to be replaced before \r and \n.
If using a .js (javascript) script, and assuming you've already extracted {{COL1}} as a variable called myVar:
Code: Select all
myVar.replace(/(?:\r\n|\r|\n)/g, "<BR>"); // Replaces \r\n, \r\, \n with <BR>
myVar.replace(/ /g, "<SP>"); // Replaces spaces with <SP>
Code: Select all
SET !VAR1 EVAL("var myVar = \"{{!COL1}}\"; myVar.replace(/(?:\\r\\n|\\r|\\n)/g, \"<BR>\"); myVar.replace(/ /g, \"<SP>\"); myVar;");
Cheers, hope this helps — please let us know how it works out!
(Also, just an FYI for future reference: it helps to include your iMacros/browser/OS versions + example code when posing questions to get a response.)
iMacros for Firefox v8.9.7 | Firefox 56.0.2, Firefox 52 ESR, Pale Moon 27.9.4
I compare performance using all 3 browsers while troubleshooting but there's rarely a discernible difference. [Installed on PM using "Moon Tester Tool" add-on]
I compare performance using all 3 browsers while troubleshooting but there's rarely a discernible difference. [Installed on PM using "Moon Tester Tool" add-on]
Re: Form Filling from CSV with Line Breaks
JamesBassdrop wrote:Hey macrohelp,macrohelp wrote:Is it possible to include line breaks when inputting from a CSV file? I've tried everything but it seems to truncate the line breaks.
Similar to how spaces need to be replaced with <SP>, to include line breaks you'll likely need to replace \r\n, \r, and \n with <BR>:
\r = carriage return
\n = line feed
\r\n = often used in preference to \n as it displays properly on both Windows and Unix/Linux
To avoid the possibility of ending up with duplicate line breaks, \r\n needs to be replaced before \r and \n.
If using a .js (javascript) script, and assuming you've already extracted {{COL1}} as a variable called myVar:Or, if using an .iim (pure iMacros) script, something like this should do the trick (again, for {{COL1}}):Code: Select all
myVar.replace(/(?:\r\n|\r|\n)/g, "<BR>"); // Replaces \r\n, \r\, \n with <BR> myVar.replace(/ /g, "<SP>"); // Replaces spaces with <SP>
(Note: I haven't specifically tested the above code, but have successfully included line breaks from a CSV file by using this method in the past.)Code: Select all
SET !VAR1 EVAL("var myVar = \"{{!COL1}}\"; myVar.replace(/(?:\\r\\n|\\r|\\n)/g, \"<BR>\"); myVar.replace(/ /g, \"<SP>\"); myVar;");
Cheers, hope this helps — please let us know how it works out!
(Also, just an FYI for future reference: it helps to include your iMacros/browser/OS versions + example code when posing questions to get a response.)
YEEEEP...!, exactly....!JamesBassdrop wrote:(Also, just an FYI for future reference: it helps to include your iMacros/browser/OS versions + example code when posing questions to get a response.)

(Reason why I didn't react to this "Low Quality" Thread/OP, even if the Qt was a bit "interesting" indeed...)
Typo btw: "posing" => "posting"...

- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
- JamesBassdrop
- Posts: 7
- Joined: Sun Jul 29, 2018 8:51 pm
- Location: Canada
- Contact:
Re: Form Filling from CSV with Line Breaks
Not a typo...chivracq wrote:Typo btw: "posing" => "posting"...
But both would work hereverb (used with object), posed, pos·ing
5. to assert, state, or put forward:
That poses a difficult problem.

iMacros for Firefox v8.9.7 | Firefox 56.0.2, Firefox 52 ESR, Pale Moon 27.9.4
I compare performance using all 3 browsers while troubleshooting but there's rarely a discernible difference. [Installed on PM using "Moon Tester Tool" add-on]
I compare performance using all 3 browsers while troubleshooting but there's rarely a discernible difference. [Installed on PM using "Moon Tester Tool" add-on]
Re: Form Filling from CSV with Line Breaks
Pfff, of course it's typo...!JamesBassdrop wrote:Not a typo...chivracq wrote:Typo btw: "posing" => "posting"...

=> Nope, sorry, "posing questions" is definitely no correct English, yeah well, grammatically maybe, but not for the "Meaning"...JamesBassdrop wrote:(Also, just an FYI for future reference: it helps to include your iMacros/browser/OS versions + example code when posing questions to get a response.)
Yep in French/Canadian we say "poser une Qt", but not in ENG..., "something is posing a posing a problem", OK...
Hum, oops, OK, you seem to be right as well indeed, but I "sense" a different meaning, it's more a subject/argument that will be posing a Qt = leading to a Qt, leading to some discussion/debate, but it sounds "strange" to me in the Context of a (Tech) Forum, there we (Users) post Qt's..., the "Content" could be posing a Qt, but not the User itself... But OK, never mind, I honestly thought you had made a Typo...

Your IP is btw "a bit dirty" for Spam, @JBD, you may want to "clean" it...

Yep, correct Use of "to pose" (against "to post")...!JamesBassdrop wrote:But both would work hereverb (used with object), posed, pos·ing
5. to assert, state, or put forward:
That poses a difficult problem.

I didn't dig at all into the Thread, waiting for @OP to post their FCI + Script...
OK, I still might if they still do so..., and follow up of course...

- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
- JamesBassdrop
- Posts: 7
- Joined: Sun Jul 29, 2018 8:51 pm
- Location: Canada
- Contact:
Re: Form Filling from CSV with Line Breaks
Perhaps "posting" may have been a better fit, but I must maintain that "posing" is correct for both meaning and grammarchivracq wrote:=> Nope, sorry, "posing questions" is definitely no correct English, yeah well, grammatically maybe, but not for the "Meaning"...

Longman Dictionary of Contemporary English wrote:pose a question
to ask a question, especially one that needs to be carefully thought about
• In her book she poses the question ‘How much do we need to be happy?’.
• He survived the surgery, and I cautiously began to pose questions.
• Yet these two enemies are also enemies of each other, which poses a question.
• That poses a question about their very nature.
• Simply put, eVote lets people pose questions and conduct votes using e-mail.
• It is open to the House to ask for reports, and it can pose questions at any time.
• Olajuwon stopped by to visit and pose a question: Could Pond help him get to college in the United States?
• In their minds, buying a gown poses questions more complicated than chiffon or lace.
• The magazine posed a list of questions to each of the candidates.
But aaanyways (intentional typo), moving on...Cambridge English Dictionary wrote:pose · verb (ASK)
• to ask a question, especially in a formal situation such as a meeting
Can we go back to the question that Helena posed earlier?

My IP address is? Hmm, interesting... that's news to me! Where does one go to check this? I wouldn't mind checking my web server's IP address too. Either way, thanks for the heads up!chivracq wrote:Your IP is btw "a bit dirty" for Spam, @JBD, you may want to "clean" it...

Cheers,
J
iMacros for Firefox v8.9.7 | Firefox 56.0.2, Firefox 52 ESR, Pale Moon 27.9.4
I compare performance using all 3 browsers while troubleshooting but there's rarely a discernible difference. [Installed on PM using "Moon Tester Tool" add-on]
I compare performance using all 3 browsers while troubleshooting but there's rarely a discernible difference. [Installed on PM using "Moon Tester Tool" add-on]