cancel
Showing results for 
Search instead for 
Did you mean: 

Read .CSV file in MII 12.2

aravinth_anandhan
Active Participant
0 Kudos

Hi,

I am trying to read a CSV file which is stored in a server via MII. I gone through a threads for this. As per the thread, using Get_File_List, I got my file name as output.

In second step they were using Text_Loader action block, here what inputs I need to give? I am using .csv file, but through Text_Loader and Text_Saver actions how can we save a .csv file to .txt file?

Can any one tell me, what are all the actions I need to use for reading a .csv file? I am using MII version 12.2.3

Thanks in advance.

Regards,

Aravinth

Accepted Solutions (1)

Accepted Solutions (1)

jcgood25
Active Contributor
0 Kudos

After the Text loader, the Flat File Parser action would normally be used to be able to repeat through the rows of data in the csv file, and the string manipulation would be up to you with the other actions and expressions.

You might want to look into this custom action:  http://scn.sap.com/docs/DOC-1776

aravinth_anandhan
Active Participant
0 Kudos

Hi Jeremy,

I have already deployed that (FlatFile to Doc) custom action. I am having .csv file in my server(this file is similar to excel sheet), so how can I map the file which is in server to this custom action?

At least, we need to get the value of that file into some local or transaction variables, so how I need to do that?

pls give me some solution for this

Regards,

Aravinth

jcgood25
Active Contributor
0 Kudos

The Text Loader action should work - then just link it into the custom action.  txt and csv files work very much the same.

aravinth_anandhan
Active Participant
0 Kudos

Hi Jeremy,

I have given D:\test.csv in a URL of text loader action. But I am getting a following error Content is not allowed in prolog. And when I give the same path inside configure links, I am getting NO_RESULT as output.

I am having a .txt file in same path. I have given like D:\test1.txt in URL and I got content of that text file as output.  Please tell me, how to mention my .csv file in a URL of text loader.

Regards,

Aravinth

jcgood25
Active Contributor
0 Kudos

Check the NW Logs - could be a permission issue, or case sensitivity issue?

Use the WB to import the text.csv file into the Web tab of your project, then drag the file into your TRX.  It should automatically create the Text loader action block.  Do the results show in a Tracer?

aravinth_anandhan
Active Participant
0 Kudos

Hi Jeremy,

I am having Super admin rights and I gave a exact name of my file, so it would not be a case sensitive issue.

I have imported test.csv file into my WEB folder and I mentioned the same file path in Text Loader action. Now I am getting a message like Loaded content was empty and Tracer returns blank output.

Have you tried reading .csv file in 12.2 ? or Am I missing anything here?

Regards,

Aravinth

jcgood25
Active Contributor
0 Kudos

Yes, I used 12.2 to load a csv file using the action block, but not directly from the file system.  I used the web path from my WB imported file.  I also double clicked on the file and it opened in Excel - is your file possibly corrupt?  Both error messages you mention would seemingly point to a problem with an empty, missing, or invalid file.

Try testing a simple query template from the workbench and select csv output, then save this file to disk and try using it to see if the original file is bad.

aravinth_anandhan
Active Participant
0 Kudos

Thanks a lot Jeremy, you are correct . The problem was my CSV file format. Now it is working fine.  

Now I am reading from a server where MII is installed(If I give any other path, it is not working). How to read from local PC or from other servers ?

If required, I will start a new discussion.

Regards,

Aravinth

shaji_chandran
Participant
0 Kudos

Hi Jeremy,

How did you use the web path from your WB imported file. I didn't understand that. Actually I am struggling to provide the value for URL property of Text Loader action block. I have saved my csv file on the same server where MII is installed. Is there any special folder such as web folder where we need to store the csv files?

My requirement is to read  the value of excel/csv file which is stored on the same server where MII is installed. I am using MII 12.2 version

Thanks

Shaji

Answers (0)