Sponsored Content
Full Discussion: Need to work in a file
Top Forums UNIX for Dummies Questions & Answers Need to work in a file Post 302719893 by Adhi on Tuesday 23rd of October 2012 10:22:55 AM
Old 10-23-2012
Need to work in a file

I have a file like this:

Code:
00510010            0000000471           000000000482.90 000000005855.49

00510015            0000000471           000000002280.81 000000003093.79

00510020            0000000471           000000023640.82 000000022857.28

00510021            0000000471           000000003455.12 000000000000.00

00510025            0000000471           000000006464.03 000000019156.78

00510030            0000000471           000000017397.31 000000025120.67

00510035            0000000471           000000001247.54 000000000000.00

00510039            0000000471           000000000000.00 000000000000.00

00510040            0000000471           000000000528.05 000000004337.89

00510045            0000000471           000000022229.84 000000005599.31

00510047            0000000471           000000088763.88 000000072880.58

00510056            0000000471           000000006249.01 000000002815.64

00530070            0000000471           000000000000.00 000000000000.00


This is just a sample of the file, the file has more than 4 million lines. This is what I need:


1. I need the leading 0s in the 3rd and 4th column removed

2. When there is a 000000000000.00 I need to be replaced with just 0

3. I need the 4th column copied over 38 more times, so I would have 42 columns in total

4. I need the file eventually converted to .csv file with the space converted to commas
Moderator's Comments:
Mod Comment Please use code tags when posting data and code samples!

Last edited by vgersh99; 10-23-2012 at 11:24 AM.. Reason: code tags, please!
 

5 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Script doesn't work, but commands inside work

Howdie everyone... I have a shell script RemoveFiles.sh Inside this file, it only has two commands as below: rm -f ../../reportToday/temp/* rm -f ../../report/* My problem is that when i execute this script, nothing happened. Files remained unremoved. I don't see any error message as it... (2 Replies)
Discussion started by: cheongww
2 Replies

2. UNIX for Dummies Questions & Answers

How does $(<file) work?

If you enter " < myfile " on shell prompt directly, nothing to output. But for ' $(< myfile) ' , the contents of myfile replace $(< myfile). That has the same effect as ' $(cat myfile) '. I never seen such usage before and dont know how $(< myfile) work. Anyone can give some explanation? (1 Reply)
Discussion started by: hongwei
1 Replies

3. UNIX for Dummies Questions & Answers

How do unix file lenghts work?

Hello, Can someone tell me how unix works out file lenghts please? If I'm ftp'ing a file from a mvs mainframe to a unix box will the file be replicated line by line? I'm looking at the file on the unix box and it's telling me the recl is almost 4000 but it's not that on the mvs side. Should a... (3 Replies)
Discussion started by: Grueben
3 Replies

4. Shell Programming and Scripting

My script work on Linux but not work in sunos.

My script work on Linux but not work in sun os. my script. logFiles="sentLog1.log sentLog2.log" intial_time="0 0" logLocation="/usr/local/tomcat/logs/" sleepTime=600 failMessage=":: $(tput bold)Log not update$(tput rmso) = " successMessage="OK" arr=($logFiles)... (7 Replies)
Discussion started by: ooilinlove
7 Replies

5. IP Networking

Discussion at work, would a router work pluging a cable in wan1 and lan1?

hi all. and sorry for the random question, but this sparkled a raging flame-war at work and i want more points of view situation a router, with linux of some sort, dhcp client requesting for ip in wan1 (as usual with wan ports) dhcp server listening in lan1, and assigning ip (as usual... (9 Replies)
Discussion started by: broli
9 Replies
GAPPLETVIEWER(1)                                                        GNU                                                       GAPPLETVIEWER(1)

NAME
gappletviewer - Load and runs an applet SYNOPSIS
appletviewer [OPTION]... URL... appletviewer [OPTION]... -code CODE appletviewer [OPTION]... -plugin INPUT,OUTPUT DESCRIPTION
The appletviewer tool loads and runs an applet. Use the first form to test applets specified by tag. The URL should resolve to an HTML document from which the appletviewer will extract applet tags. The APPLET, EMBED and OBJECT tags are supported. If a given document contains multiple applet tags, all the applets will be loaded, with each applet appearing in its own window. Likewise, when multiple URLs are specified, each applet tag instance is given its own window. If a given document contains no recognized tags the appletviewer does nothing. appletviewer http://www.gnu.org/software/classpath/ Use the second form to test an applet in development. This form allows applet tag attributes to be supplied on the command line. Only one applet may be specified using the -code option. The -code option overrides the URL form -- any URLs specified will be ignored. appletviewer -code Test.class -param datafile,data.txt gcjwebplugin uses the third form to communicate with the appletviewer through named pipes. OPTIONS
URL OPTIONS -debug This option is not yet implemented but is provided for compatibility. -encoding CHARSET Use this option to specify an alternate character encoding for the specified HTML page. APPLET TAG OPTIONS -code CODE Use the -code option to specify the value of the applet tag CODE attribute. -codebase CODEBASE Use the -codebase option to specify the value of the applet tag CODEBASE attribute. -archive ARCHIVE Use the -archive option to specify the value of the applet tag ARCHIVE attribute. -width WIDTH Use the -width option to specify the value of the applet tag WIDTH attribute. -height HEIGHT Use the -height option to specify the value of the applet tag HEIGHT attribute. -param NAME,VALUE Use the -param option to specify values for the NAME and VALUE attributes of an applet PARAM tag. PLUGIN OPTION -plugin INPUT,OUTPUT gcjwebplugin uses the -plugin option to specify the named pipe the appletviewer should use for receiving commands (INPUT) and the one it should use for sending commands to gcjwebplugin (OUTPUT). DEBUGGING OPTION -verbose Use the -verbose option to have the appletviewer print debugging messages. STANDARD OPTIONS -help Use the -help option to have the appletviewer print a usage message, then exit. -version Use the -version option to have the appletviewer print its version, then exit. -JOPTION Use the -J option to pass OPTION to the virtual machine that will run the appletviewer. Unlike other options, there must not be a space between the -J and OPTION. BUGS
SEE ALSO
AUTHOR
0.98 2010-07-05 GAPPLETVIEWER(1)
All times are GMT -4. The time now is 10:01 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy