Sponsored Content
Operating Systems Linux Output formatting problem..Plz hlp Post 302208217 by joeyg on Monday 23rd of June 2008 09:39:53 AM
Old 06-23-2008
Hammer & Screwdriver Do you have to do all that Excel and Word stuff?

Before approaching from unix, Excel will read csv (comma separated values) files without having to do much of anything. I write to csv [use a , instead of | as delimiter] whenever I need to create something for my users that they will want to open in Excel.

What I am thinking is:
(a) create your "|" delimited file [coding already in-place]
(b) follow-up script to read that file and create a .txt output file

The follow-up would be roughly:

Code:
rm printfile.txt
while read zf
   do
   fld1=$(echo "$zf" | cut -d"|" -f1)
   fld2=$(echo "$zf" | cut -d"|" -f2)
   fld3=$(echo "$zf" | cut -d"|" -f3"
   echo "Name: "$fld1 >>printfile.txt
   echo " " >>printfile.txt
   echo ...
     {rest of echo lines per record}
done

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to download Red hat plz Hlp ?

ftp://metalab.unc.edu/pub/Linux/distributions/ Hi all , I know how to go to the distibution site but How to download if using ftp I want to ask this Q:confused: (3 Replies)
Discussion started by: atiato
3 Replies

2. UNIX for Dummies Questions & Answers

How to connect to the Internet Using RH 7.2 i.e configuration plz Hlp

How to connect to the Internet Using RH 7.2 i.e configuration plz Hlp.....cause I want to accsses to the Internet to download Help and application in the Red hat OS???? (1 Reply)
Discussion started by: atiato
1 Replies

3. UNIX for Dummies Questions & Answers

plz Help How should I configure cc compiler output file plz help???

i.e configuration of C compiler :confused: (4 Replies)
Discussion started by: atiato
4 Replies

4. UNIX for Dummies Questions & Answers

What is the output of that Shell Scripts Plz tell me

tr "" "" | sort | awk 'length($0)>0' | uniq -c (1 Reply)
Discussion started by: brain_full
1 Replies

5. Shell Programming and Scripting

Output formatting prob.. guyz plz hlp

:)Hi guys, I have written a script that returns 3 things of all the employees in my organisation. i.e. Name, Login time & log out time of each and every employee. It returns the output in pipe-delimited format. For your ref. sending a small sample e.g. Deepti|083032|174501... (5 Replies)
Discussion started by: anushree.a
5 Replies

6. Shell Programming and Scripting

output formatting problem

I would like to keep the complete lines in the output, but my script adds carriage returns for each space (e.g. keep BRITISH AIRWAYS on one line in the output): File1= BAW BRITISH AIRWAYS RYR RYAN AIR for i in $(cat File1) do echo $i done Output: BAW BRITISH AIRWAYS RYR... (4 Replies)
Discussion started by: barny
4 Replies

7. Shell Programming and Scripting

Need some Help for file filteration and saving the output in other directory using grep....plz ...

Hi all........ Plss do help me.......in a big trouble... :wall::wall::wall: I have 3 directories named as :1. /home/shuchi/source 2./home/shuchi/destination 3./home/shuchi/filter now the problem is /home/shuchi/source has say 2 files with extension .txt as given below : A.txt Code: ... (0 Replies)
Discussion started by: ektubbe
0 Replies

8. Shell Programming and Scripting

Problem in formatting output of SQL query in excel sheet in shell script

Hi Guys.. Need your help to format the output of my shell script. I am using spool command to take out put in csv file. below is my code. (for example) col USERNAME for a15 col EMAIL for a30 col FULL_NAME for a20 col LAST_LOGIN for a40 col DATE_CREATED for a40 SPOOL 120.csv... (3 Replies)
Discussion started by: Agupte
3 Replies

9. Shell Programming and Scripting

Output formatting problem

Hello; I have a simple loop filtering a log: for LU in $(< LU-list-Final) do OUT=$(grep -B1 $LU cibc-src-ip.cap |egrep 'IP 16|IP 19|IP 15' |awk -F">" '{print $1}') if ; then echo " LU $LU was accessed by ===============> $OUT " echo "" fi done The current output snippet looks like... (2 Replies)
Discussion started by: delphys
2 Replies

10. Shell Programming and Scripting

Problem in formatting output in sed / awk

I have a file like this : ! 1 ! 542255 ! 50,140.00 ! ! 2 ! 551717 ! 5,805.00 ! ! 3 ! 551763 ! 8,130.00 ! ! 4 ! 551779 ! 750.00 ! ! 5 ! 551810 ! 56,580.00 ! ! 6 ! 551816 ! 1,350.00 ! ! 7 ! 551876 ! 360.00 ! ! 8 ! 551898 ! ... (10 Replies)
Discussion started by: adam1969in
10 Replies
MMCFORMAT(8)						    BSD System Manager's Manual 					      MMCFORMAT(8)

NAME
mmcformat -- format optical media SYNOPSIS
mmcformat [-BDFGHhIMOpRrSsw] [-b blockingnr] [-c cert-num] special DESCRIPTION
The mmcformat utility formats optical media conforming to the MMC standard. This includes CD, DVD, and Blu-Ray (BD) media. The options are as follows: -B Blank media when possible before formatting it. -b blockingnr Explicitly select packet size in sectors (for CD-RW only). It is not recommended to change this from its default of 32. -c cert-num Certify media for DVD-RAM / DV-RE. The argument cert-num specifies: 0 no certification 1 full certification 2 quick certification -D Debug mode. Print all SCSI/ATAPI command errors. -F Format media. -G Grow last CD-RW/DVD-RW session. -H Show help and print formatting choices for the inserted media. -h Show help and print formatting choices for the inserted media. -I Show help and print formatting choices for the inserted media. -M Select MRW (Mount Rainier) error correcting background format. -O Old style CD-RW formatting; recommended for CD-RW. -p Explicitly set packet format. -R Restart previously stopped MCD-MRW or DVD+RW background format. -r Recompile defect list for DVD-RAM. -S Grow spare space DVD-RAM / BD-RE. -s Format DVD+MRW / BD-RE with extra spare space. -w Wait until completion of background format. NOTES
Due to the enormous varieties in optical media, mmcformat is made as generic as possible. This can result in confusion. EXAMPLES
mmcformat -B -O /dev/rcd0d Blanks and then formats a CD-RW disc using the ``old style'' format command. It is recommended to use this ``old style'' command unless your drive reports that it's not supported; in that case, resort to the default -F. Note that a CD-RW disc can be reformatted without being blanked. Blanking switches between sequential and fixed packet writing by erasing the disc. This can also help to revive old discs. mmcformat -F -M /dev/rcd0d Format a CD-RW or a DVD+RW to use MRW (Mount Rainier). This format tries to hide media flaws as much as possible by relocation. SEE ALSO
scsictl(8) HISTORY
The mmcformat command first appeared in NetBSD 5.0. AUTHORS
Reinoud Zandijk <reinoud@NetBSD.org> BUGS
mmcformat could be merged with scsictl(8) but that tool is very hard disk oriented. BSD
May 9, 2008 BSD
All times are GMT -4. The time now is 02:14 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy