Sponsored Content
Top Forums Shell Programming and Scripting Print each paragraph in a text file into excel file Post 302777941 by prash358 on Friday 8th of March 2013 07:26:21 PM
Old 03-08-2013
Not sure i am getting below syntax errors.

Quote:
awk '
NR==1||/^ *$/{rec++}
{
sep=a[rec,$1]?"\n":"";
a[rec,$1]=a[rec,$1] sep $2
}
END{printf("dn\tuser_ok\tuser_bad\n");
for(i=1;i<=rec;i++)
printf("\"%s\"\t\"%s\"\t\"%s\"\n", a[i,"dn"], a[i,"user_ok"], a[i,"user_bad"])
}' FS=": *"


Quote:
test@unix1 >./test.sh input.txt > out.csv
awk: syntax error near line 4
awk: illegal statement near line 4
awk: syntax error near line 5
awk: illegal statement near line 5
awk: syntax error near line 9
awk: illegal statement near line 9
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

text file to excel or csv

Hi, I have a text file like ---------------------- aaa|bbb|ccc|ddd|eee fff|gggg|hhhhhh|kkkk -------------------- I have a script which will transfer(thourgh FTP) this text file to windows system. But I want to covert it into excel or CSF then upload into windows system.. thanks (9 Replies)
Discussion started by: srikanthus2002
9 Replies

2. UNIX for Dummies Questions & Answers

Script to generate text file from excel file

Hello, I have a excel file which has almost ten columns on the shared drive. I have to write a shell script to ftp that daily to unix server and then extract some columns from there and generate oracle standard text file. The columns should be in proper order and aligned properly, otherwise... (1 Reply)
Discussion started by: isingh786
1 Replies

3. UNIX for Dummies Questions & Answers

Output text from 1st paragraph in file w/ a specific string through last paragraph of file w/ string

Hi, I'm trying to output all text from the first paragraph in a file that contains a specific string through the last paragraph in that file that contains that string. Previously, I was outputting just each paragraph with that search string with: cat in_file | nawk '{RS=""; FS="\n";... (2 Replies)
Discussion started by: carpenn
2 Replies

4. Shell Programming and Scripting

Easy way to pull a paragraph from a text file?

I have a collection of text files that comprise a mailing list archive. I grep them to find an email that interests me, then open the file in a text editor to find the surrounding paragraph of text. Is there an easy way to do this from the shell instead? (2 Replies)
Discussion started by: CRGreathouse
2 Replies

5. Shell Programming and Scripting

How to print excel file / csv file in solaris server ?

Hi, I have to print a excel file in solaris server. I am using lexmark printer with post script printer driver . But the problem is when i am using " lp -d <printer name> <somefile name.xls>" command it is not printing correctly. but for pdf file using the same command it printing correctly. ... (2 Replies)
Discussion started by: Sambuddha
2 Replies

6. Shell Programming and Scripting

How to convert excel file to csv file or text file?

Hi all, I need to find a way to convert excel file into csv or a text file in linux command. The reason is I have hundreds of files to convert. Another complication is the I need to delete the first 5 lines of the excel file before conversion. so for instance input.xls description of... (6 Replies)
Discussion started by: johnkim0806
6 Replies

7. Shell Programming and Scripting

Need to convert delimited text file in UNIX to an Excel file

Dear Users , Need to convert delimited text files in UNix server to an Excel file and move the excel file to Windows environment. Am trying to automate the whole process. Can anyone share the ideas,if they have done similar ones before...Thanks -Meera (1 Reply)
Discussion started by: meerakrish
1 Replies

8. Shell Programming and Scripting

Need help to write a shell script to convert text file to excel file.

Hi Everyone, I want your help to write a script which will take text file as input and on the basis of delimiter ":"script will create excel sheet. Example input: IpAdress:InstanceName:Port:ServerName 10.255.255.1:abc:2232:xyz_abc Output should be an excel sheet like below: Column... (8 Replies)
Discussion started by: akabhinav18
8 Replies

9. UNIX for Beginners Questions & Answers

Convert Excel File (xls) to tab delimited text file on AIX

Hi i have a problem in my job i try to convert an excel file (xls extention) to text file (tab delimited), but no result with this comand cat xxx.xls > xxx.txt Do you have eny idea? PS: sorry for my english Thanks!! (4 Replies)
Discussion started by: frisso
4 Replies

10. Shell Programming and Scripting

Match text to lines in a file, iterate backwards until text or text substring matches, print to file

hi all, trying this using shell/bash with sed/awk/grep I have two files, one containing one column, the other containing multiple columns (comma delimited). file1.txt abc12345 def12345 ghi54321 ... file2.txt abc1,text1,texta abc,text2,textb def123,text3,textc gh,text4,textd... (6 Replies)
Discussion started by: shogun1970
6 Replies
PLAYWAV(1)						    Voicetronix Telephony Tools 						PLAYWAV(1)

NAME
playwav - Play an audio file to a Voicetronix hardware port SYNOPSIS
playwav [options] file DESCRIPTION
The playwav utility sends audio data from a wav file to a port. OPTIONS
The following options are available: --card number Explicitly select the card to test. Default is card 0. --port number Explicitly select the port to test. Default is port 0 of the specified card. --playgain db Set the playback gain. --recgain db Set the recording gain. Only useful with the --rec option. --dial digits Dial the given digits during playback. --ring Wait for the line to ring before playing. Only useful for FXO ports. --rec outfile Record the incoming signal while playing. Useful for cut-through testing. --loop Enable tx->rx loopback. Useful for echo testing, but not supported for all hardware types. --hostecho Enable the host based echo canceller. SEE ALSO
recwav(1) AUTHOR
Ron Lee, David Rowe, Voicetronix <support@voicetronix.com.au> This manual page was written by Ron <ron@debian.org>, for the Debian project (but may be used by others). VPB driver package Feb 4, 2007 PLAYWAV(1)
All times are GMT -4. The time now is 02:08 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy