Save !EXTRACT to specified column

Discussions and Tech Support related to website data extraction, screen scraping and data mining using iMacros.

Moderators: Community Moderators, iMacros Moderators

Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the Google search box (at the top of each forum page) to see if a similar problem or question has already been addressed. This will search the entire contents of the forums as well as the iMacros Wiki.
3. We can respond much faster to your posts if you include the following information:

CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST

Answering your own posts (e.g. attempting to "bump" your topic) drops your topic from the list of unanswered threads, so it may actually receive less views.

Save !EXTRACT to specified column

by Magikarp on Fri Aug 26, 2016 1:51 pm

Hello there,

i have a question regarding extracting information to a csv file. Whenever i try to extract several pieces of information from a website, save them to a csv file, and then arrange them across multiple columns in a single row it doesn't seem to work. To my knowledge, the following piece of code should lead to the value

Code: Select all
ADD !EXTRACT {{!VAR1}}
' This is the value i want to save to my csv file
SET !EXTRACT {{!COL3}}
' This *should* specify that i want to save it in the third column
...
SAVEAS TYPE=EXTRACT FOLDER=C:\Users\Piet\Desktop FILE=Template.csv


However, this doesn't put it in the third column, but in the third row. Is it possible somehow to somehow swap this? I don't want to keep transposing my tables in my .csv file afterwards :(
Magikarp
 
Posts: 4
Joined: Fri Aug 26, 2016 1:43 pm

Re: Save !EXTRACT to specified column

by chivracq on Fri Aug 26, 2016 10:00 pm

Magikarp wrote:Hello there,

i have a question regarding extracting information to a csv file. Whenever i try to extract several pieces of information from a website, save them to a csv file, and then arrange them across multiple columns in a single row it doesn't seem to work. To my knowledge, the following piece of code should lead to the value

Code: Select all
ADD !EXTRACT {{!VAR1}}
' This is the value i want to save to my csv file
SET !EXTRACT {{!COL3}}
' This *should* specify that i want to save it in the third column
...
SAVEAS TYPE=EXTRACT FOLDER=C:\Users\Piet\Desktop FILE=Template.csv


However, this doesn't put it in the third column, but in the third row. Is it possible somehow to somehow swap this? I don't want to keep transposing my tables in my .csv file afterwards :(

Shouldn't be a Pb from your Thread Title, I would think...
CIM...! :mrgreen: ... to read your Post...
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 6485
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: Save !EXTRACT to specified column

by Magikarp on Sat Aug 27, 2016 6:06 am

Sorry, i'm new here. Version of my Imacros is 8.9.7, of Firefox 48.0.2, and i use Windows 7.
In retrospect there are several subforums suitable for my query (as i use Firefox), so if anybody feels it should be moved that's fine.

Anyway, the problem still persists (and no, i don't know what a PB is :?: ).
Magikarp
 
Posts: 4
Joined: Fri Aug 26, 2016 1:43 pm

Re: Save !EXTRACT to specified column

by chivracq on Sat Aug 27, 2016 7:15 am

Magikarp wrote:Sorry, i'm new here.
Code: Select all
Version of my Imacros is 8.9.7, of Firefox 48.0.2, and i use Windows 7.

In retrospect there are several subforums suitable for my query (as i use Firefox), so if anybody feels it should be moved that's fine.

Anyway, the problem still persists (and no, i don't know what a PB is :?: ).

"Pb" = "Problem"...

OK, perfect for FCI (Full Config Info), always mention your FCI when you open a Thread, many Commands are not implemented for all Browsers/Versions...

Sub-Forum is fine...

OK, if I understand your Pb correctly, you want to save the Content of '!VAR1' into Col_3 of your '.CSV' File.
You don't need to use '!COL3' which would be to access the Content of Col_3 from a '.CSV' File that you would be using as a DataSource to input Data.

'SAVEAS TYPE=EXTRACT' is what you need indeed and it will save the Content of the '!EXTRACT' Var which is an Array and contains all Extracts you did in your Script. So if you had already 2 Extracts (or other 'ADD !EXTRACT ...' Statements) in your Script before your 'ADD !EXTRACT {{!VAR1}}', this Statement should be fine by itself and you don't need at all your 'SET !EXTRACT {{!COL3}}' which replaces the Content of '!EXTRACT' by '{{!COL3}}' which is probably "_Undefined_".

The following Script should work directly, and I've added 2 PROMPT's for you to understand how '!EXTRACT' gets built and you should get 3 Entries in the 2nd PROMPT separated by '[EXTRACT]':
Code: Select all
PROMPT {{!EXTRACT}}
ADD !EXTRACT {{!VAR1}}
' This is the value i want to save to my csv file
PROMPT {{!EXTRACT}}
...
SAVEAS TYPE=EXTRACT FOLDER=C:\Users\Piet\Desktop FILE=Template.csv
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 6485
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)


Return to Data Extraction and Web Screen Scraping

Who is online

Users browsing this forum: No registered users and 2 guests

-->