peter-cooper
asked on
CSV export single column not inserting comma's in file
Hello
I have a single column in excel 2013 and when I try to export or save as a csv comma delimited file, it dosen't put the comma's in. Is there a special way to export a csv comma delimited.
I would be grateful if someone could give me suggestions that I could try. thanks
I have a single column in excel 2013 and when I try to export or save as a csv comma delimited file, it dosen't put the comma's in. Is there a special way to export a csv comma delimited.
I would be grateful if someone could give me suggestions that I could try. thanks
ASKER
@Norie I need to retain the format like in the code. If I do more than 1 column, then rhe 2nd column does not contain any commas
DEMOBILL001,DEMO10802,DEMO11122,DEMO6423,DEMO7462,DEMO7479,DEMO7479A,DEMO25,DEMO10079
I'm afraid I'm not following, I thought you only wanted to save/export one column to a CSV file?
Is the data you posted an example of what you have in one of the cells of the column you want to save?
Is the data you posted an example of what you have in one of the cells of the column you want to save?
ASKER
@Norie That is an example when I output directly from myphpadmin. However, My excel column is just one straight column. Thus:
5601
5602
5603
etc
Guess my question is, if you need to just output 1 column to a comma csv file, is is possible. Thanks
5601
5602
5603
etc
Guess my question is, if you need to just output 1 column to a comma csv file, is is possible. Thanks
The commas are used to separate the data between each column. If there is only one column, they are not needed. There is no 'between'.
ASKER
@Graham Thanks for response. However, when I import my csv into appication it is displaying all on 1 line and not in a column. I went into my debugging tool and this is what is neing input into app.
["5808\r\n5810\r\n5813\r\n5941\r\n5949\r\n5950\r\n5958\r\n5959\r\n5960\r\n5962\r\n5961\r\n5963\r\n6010
\r\n6016\r\n6017\r\n6018\r\n6021\r\n6023\r\nS5809\r\nS5811\r\nS5812\r\nS5814\r\nS5815\r\nS5942\r\nS5943
\r\nS5944\r\nS5945\r\nS5946\r\nS5947\r\nS5948\r\nS5951\r\nS5952\r\nS5953\r\nS5954\r\nS5955\r\nS5956\r
\nS5957\r\nS6000\r\nS6001\r\nS6002\r\nS6003\r\nS6004\r\nS6005\r\nS6006\r\nS6007\r\nS6008\r\nS6009\r\nS6011
\r\nS6012\r\nS6013\r\nS6014\r\nS6015\r\nS6019\r\nS6020\r\nS6022\r\nS6024\r\nS6025\r\nS6026\r\nS6027\r
\nS6028\r\nS6029\r\n"]
You might have to do some pre-processing, depending on the exact way in which the data is arranged. Can you post a non-confidential example of the worksheet?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
greetings peter-cooper, , ,
You do not have much of a problem, because PHP has a very useful function as file ( ) .
This function is used to read a text file, and use the "New Line" text markers as \r or \n to know where to separate a text file into an Array.
you could use it like -
Information about function file( ) is in manual -
http://php.net/manual/en/function.file.php
You do not have much of a problem, because PHP has a very useful function as file ( ) .
This function is used to read a text file, and use the "New Line" text markers as \r or \n to know where to separate a text file into an Array.
you could use it like -
$arrayLines = file ( 'listOfID.txt' , FILE_IGNORE_NEW_LINES );
echo 'Id Numbers in the FILE are: <br />';
for ($i = 0; $ < count($arrayLines); ++$i) [
echo $arrayLines[$i].', ';
}
Information about function file( ) is in manual -
http://php.net/manual/en/function.file.php
ASKER
Thank you Ray
ASKER
Thanks for response slick
Where would the go?
What would they be separating?