writing to file question


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting writing to file question
# 1  
Old 05-23-2008
writing to file question

when i do a echo on my variable and paste into excel, the result is like this
ignore the commas here, just take it as if they're blank space, since i doing something else with it
Code:
AutoMicroReport_51542.txt, APL FRANCE (004E), 20080508 11:16, APL ZIRCON 028S, BTSHIP, 91,58, AUADL,40,GP,U,T01,29,1,1,0,, YPSUSR
AutoMicroReport_51542.txt, APL FRANCE (004E), 20080508 11:16, APL ZIRCON 028S, BTSHIP, 91,58, AUADL,20,AB,H,T06,5,6,1,0,, YPSUSR
AutoMicroReport_51542.txt, APL FRANCE (004E), 20080508 11:16, APL ZIRCON 028S, BTSHIP, 91,58, AUADL,40,HC,M,T06,3,7,2,0,, YPSUSR
AutoMicroReport_51542.txt, APL FRANCE (004E), 20080508 11:16, APL ZIRCON 028S, BTSHIP, 91,58, AUSYD,40,GP,L,T03,23,6,3,0,, YPSUSR


however after i write to a file and copy from the file and paste into excel, the output is like this

Code:
AutoMicroReport_51542.txt	 APL FRANCE (004E)	 20080508 11:16	 APL ZIRCON 028S	 BTSHIP	91	58	 AUADL	40	GP	U	T01	29	1	1	0		 YP
SUSR																	
AutoMicroReport_51542.txt	 APL FRANCE (004E)	 20080508 11:16	 APL ZIRCON 028S	 BTSHIP	91	58	 AUADL	20	AB	H	T06	5	6	1	0		 YPS
USR																	
AutoMicroReport_51542.txt	 APL FRANCE (004E)	 20080508 11:16	 APL ZIRCON 028S	 BTSHIP	91	58	 AUADL	40	HC	M	T06	3	7	2	0		 YPS
USR


the problem comes in when the line exceeds the screen and go to the next line, and when trying to copy and paste, the line won't follow my desired format

Last edited by finalight; 05-23-2008 at 05:31 AM..
# 2  
Old 05-23-2008
Question Are you trying to open and see the file on a pc?

If so, there are some products out there that may be better suited to open and look at text files.

One is called the File Viewer (see V - The File Viewer). This product does not appear to wrap lines of text.
Another product that might be helpful is Monarch (see Datawatch. Enterprise Content Management - Data Mining Software - Knowledge Management - Monarch Report Mining). Although this is designed to convert all kinds of files, and might be over-kill.

Back to your initial issue though, what is wrong with writing a csv file so Excel can open automatically? Why do you want to manually copy/paste? I write files to csv for Excel purposes all the time.
# 3  
Old 05-26-2008
the thing i'm doing on unix shell scripting, so I not sure if there's an ability to create excel file and write it onto the spreadsheet directly or not

i also viewing the files on the putty alone...so i can't use any other kind of file view..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Question about writing a bash script

Hello, I want to write a bash script to delete the content after '#'. However, if '#' appears in a string with "", ignore this. For example, input file: test #delete "test #not delete" Output file: test "test #not delete" Does anyone know how to write this script? Thanks (1 Reply)
Discussion started by: jeffwang66
1 Replies

2. Shell Programming and Scripting

awk - writing matching pattern to a new file and deleting it from the current file

Hello , I have comma delimited file with over 20 fileds that i need to do some validations on. I have to check if certain fields are null and then write the line containing the null field into a new file and then delete the line from the current file. Can someone tell me how i could go... (2 Replies)
Discussion started by: goddevil
2 Replies

3. UNIX for Dummies Questions & Answers

Writing a script that will take the first line from each file and store it in an output file

Hi, I have 1000 files names data1.txt through data1000.txt inside a folder. I want to write a script that will take each first line from the files and write them as output into a new file. How do I go about doing that? Thanks! (2 Replies)
Discussion started by: evelibertine
2 Replies

4. UNIX for Dummies Questions & Answers

Need help in not fetching a file while file writing operation is not completed

Hi All, We have a Unix program in oracle when we run the program this connects to specified ftp and will get the file into local server. We are facing a problem like when file writing operations is not completed, this program is getting the incomplete file. Could anyone please help me... (2 Replies)
Discussion started by: world.apps
2 Replies

5. Shell Programming and Scripting

Quick Question concerning Reading and Writing

First off, this is not homework nor for any class. I have a file (column) of data such as: 12.56 2.78 0.54 22.7 ... etc. (call the file "num") I want to read in each line, then check to see whether it's greater than or equal to a value, say "1". If it is, save it in one file, if it's... (8 Replies)
Discussion started by: astropi
8 Replies

6. Shell Programming and Scripting

reading a file extracting information writing to a file

Hi I am trying to extract information out of a file but keep getting grep cant open errors the code is below: #bash #extract orders with blank address details # # obtain the current date # set today to the current date ccyymmdd format today=`date +%c%m%d | cut -c24-31` echo... (8 Replies)
Discussion started by: Bruble
8 Replies

7. Homework & Coursework Questions

Question writing a shell script

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Write a shell script that allows the user to run the following commands: ps top cmp netstat Once ... (3 Replies)
Discussion started by: qbnlnk
3 Replies

8. Shell Programming and Scripting

Writing file name and date from LS command into a file to be imported into mysql

I am looking to do a ls on a folder and have the output of the ls be structured so that is is modificaiton date, file name with the date in a format that is compatible with mysql. I am trying to build a table that stores the last modification date of certain files so I can display it on some web... (4 Replies)
Discussion started by: personalt
4 Replies

9. Shell Programming and Scripting

Searching for Log / Bad file and Reading and writing to a flat file

Need to develop a unix shell script for the below requirement and I need your assistance: 1) search for file.log and file.bad file in a directory and read them 2) pull out "Load_Start_Time", "Data_File_Name", "Error_Type" from log file 4) concatinate each row from bad file as... (3 Replies)
Discussion started by: mlpathir
3 Replies

10. Programming

Vi question for writing source code

Hi guys, I'm modifying an old f77 code using vi. I'm modifying the code remotely from my windows machine using xming using vi. I'm using tabs to move past the first 6 columns of the code and to keep my loops and if statements neat, but when I hit the tab key, vi displays a big red block which is... (7 Replies)
Discussion started by: rks171
7 Replies
Login or Register to Ask a Question