I thought I'd toss in the reason why the O/P was having issues though. The source of the problem is the awk
nueva_hora contains 000543 which when placed on a command as a number, rather than as a string, is interpreted as an octal value and the leading zeros are 'absorbed.' To see this, run this simple awk:
Opening and closing the single quotes to insert shell variables helps to lead to this problem which is why doing that is one of my pet peeves. Assuming the awk being used is modern, then this code would have prevented the problem (though I still like Chubler_XL's solution better):
How do I trim the leading zeroes, and (+,-) in the currency field ?
I have a text file.
Your bill of +00002780.96 for a/c no. 25287324 is due on 11-06.
Your bill of +00422270.48 for a/c no. 28931373 is due on 11-06.
I want the O/P file to be like.
Your bill of 2780.96 for a/c no. 25287324... (22 Replies)
Hello, I am (trying) to write a script that will check to see how many users are logged on to my machine, and if that number is more than 60 I need to kill off all the oldest sessions that are over 60. So far I have been able to check how many users are on and now I am at the part where I have to... (3 Replies)
Helo ,
I m writing small module of c.on RHEL 4
I have one buffer (for e.g. buffer = "002"
now I want to check whethere buffer contains leading zeroes and if it contains
leading zeroes then I want to remove all leading zeroes
( i.e. if buffer = "002" then I want to make buffer = "2")
how... (1 Reply)
Hi,
I need add leading zeroes to a field in a file based on the character count. The field can be of 1 character to 6 character length. I need to make the field 14bytes.
eg:
8351,20,1
8351,234,6
8351,2,0
8351,1234,2
8351,123456,1
8351,12345,2
This should become.
... (3 Replies)
I have th following file
0000000011
0000000001
0000000231
0000000001
0000000022
noow when i run the following command
sed 's/^0+//g' file name
I receive the same output and the leading zeroes are not removed from the file . Please let me know how to achieve... (4 Replies)
Hi Forum.
I tried searching the forum but couldn't find a solution for my question.
I have the following data and would like to have a sed syntax to remove the leading zeroes from the 2nd field only:
Before:
2010-01-01|123|1|1000|2000|500|1500|600|700... (18 Replies)
Hi,
I have some hundreds/thousands of files named logX.dat, where X can be any integer, and they are sequential, X ranges between 1 and any number:
log1.dat log2.dat log3.dat log6.dat log10.dat ... log6000.dat
I would like to rename them to
scatter_params_0001.dat... (6 Replies)
Hello,
I got a question. I have several csv files with lots of data in it and for the first column i have EAN codes.
The problem that i am facing is that some of these codes have the leading 0 removed so they are 12 or less chars while a EAN code is (always?) 13 chars.
For this i used a... (9 Replies)
The awk below executes and produces the current output. it skips the header in row 1 and prints $4,$5,$6 and then adds the header row back.
The problem is that it keeps the tailing tab and prints it in front of $1. I could add a pipe to remove the tab, but is there a better way to do it with on... (7 Replies)
Discussion started by: cmccabe
7 Replies
LEARN ABOUT DEBIAN
runxlrd
RUNXLRD(1) General Commands Manual RUNXLRD(1)NAME
runxlrd - extract data from Microsoft Excel spreadsheet files
SYNOPSIS
runxlrd [options] command [input-file-patterns]
DESCRIPTION
This manual page documents briefly the runxlrd command.
runxlrd offers a commandline interface to the Python xlrd module; it extracts data from Microsoft Excel spreadsheet files.
OPTIONS -h, --help
Show summary of options and exit.
-l logfilename
Contains error messages.
-v verbosity, --verbosity=verbosity
Level of information and diagnostics provided.
-p pickleable, --pickleable=pickleable
1: ensure Book object is pickleable (default); 0: don't bother.
-m mmap, --mmap=mmap
1: use mmap; 0: don't use mmap; -1: accept heuristic.
-e encoding, --encoding=encoding
Encoding override.
-f formatting, --formatting=formatting
0 (default): no fmt info 1: fmt info (all cells) 2: fmt info (margins trimmed).
-g gc, --gc=gc
0: auto gc enabled; 1: auto gc disabled, manual collect after each file; 2: no gc.
-s onesheet, --onesheet=onesheet
Restrict output to this sheet (name or index).
COMMANDS
Valid commands are
o dump
o count_records
o version
o hdr
o ov
o show
o 2rows
o 3rows
o bench
o names
o name_dump
o labels
o xfc
o hotshot
o profile
See the xlrd API documentation for the meaning of these commands.
EXAMPLES
To show the first, second and last rows of each sheet in each file, run
$ runxlrd 3rows *blah*.xls
Run
$ runxlrd -e koi8_r 3rows myfile.xls
to explicitly pass the needed codepage to xlrd, e.g. if the codepage record is missing, or if it exists but is wrong.
SEE ALSO
The xlrd API documentation, shipped in the file xlrd.html.
The xlrd website <http://www.lexicon.net/sjmachin/xlrd.htm>.
AUTHOR
runxlrd was written by John Machin.
This manual page was written by Joost van Baal <joostvb+debian@uvt.nl>, for the Debian project (but may be used by others).
xlrd 0.6.1a4 2007-05-24 RUNXLRD(1)