12-06-2004
AWK--does anyone remember it
I am trying to run awk on a 55 page Word document.
I wanted to delete every occurrence of <company>, <script>, </scripts> from the file then cut & paste all of the appropriate fields to an Excel spreadsheet.
Also the code is suppose to replace the dates in a new format such as "xxxx-xx-xx" Is there someone out there who can help?
I tried saving my code in a .exe file on Linux, as follows:
awk -F, Test1
BEGIN
{
date1[i]= " "
temp[i]= " "
date2[i]= " "
i = 0
for(i = 1; i <= NF; i = i + 1)
{
wk -F, Test1
BEGIN
{
date1[i]= " "
temp[i]= " "
date2[i]= " "
i = 0
for(i = 1; i <= NF; i = i + 1)
{
date1[i]= "20040811"
date2[i]="xxxx-xx-xx"
next
}
END
9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Well it's been a long time since I have used any OS besides apples and windows (raising my son). My principal would like our teachers to use UNIX as their mail system. That's not a problem, the mail system is like riding a bike you never forget. Here's my problem. She wants me to write a script... (2 Replies)
Discussion started by: catbad
2 Replies
2. UNIX for Dummies Questions & Answers
hi, I know we can do this; but dont know how..
I open a file using vim..browse thru it and then say :wq after reaching some line;
The next time I open the same file, I want vim to position the cursor on the line where I left last time;
anyone? (2 Replies)
Discussion started by: spopuri
2 Replies
3. UNIX for Dummies Questions & Answers
I have a simple script. I have tried this in Bourne, Korn and C shells in my AIX ...no luck
unset STARTQUEUE
# Check parameters
if
then
echo "*E* Batch Queue parameter is missing"
else
$BATCHQ/bin/setup.sh
STARTQUEUE=$1
# If the queue doesn't exist, create it
... (3 Replies)
Discussion started by: KenL
3 Replies
4. Forum Support Area for Unregistered Users & Account Problems
Hi All,
Have only recently returned to Unix.com due to other activities (*oh the shame of it all).
Anyways, when I initially came back to redesigned/revamped site I couldn't remember any of my logins. I'd originally thought that I'd used the UID of 'Cameron' but couldn't remember any details... (2 Replies)
Discussion started by: Cameron
2 Replies
5. Shell Programming and Scripting
Hello dear community!
I have the following task to accomplish: there is a directory with approximately 2 thousand files. I have to write a script which would randomly extract 200 files on the first run. On the second run it should extract again 200 files but that files mustn't intersect with... (5 Replies)
Discussion started by: sidorenko
5 Replies
6. UNIX for Dummies Questions & Answers
I have a master list of hosts, and a list of bad hosts. I want to filter out the bad hosts from the master list. I was trying a few for loops but it's not providing the desired result:
for i in $(cat master_host_list);do grep -iv $i bad_host_list;done | sort | uniq
# won't work because it... (5 Replies)
Discussion started by: MaindotC
5 Replies
7. What is on Your Mind?
It showed a cleaning woman (probably in the evening, after most of the other employees had left work) happily typing commands on a dot matrix terminal (could've been a DEC LA120, IIRC) just because "unix is so easy to use, even a cleaning woman can use it!".
If you know where to find a scanned... (2 Replies)
Discussion started by: mathiasbage
2 Replies
8. Post Here to Contact Site Administrators and Moderators
Howdy,
I clicked the rememberer me when I log in, and evidently I really do not understand what that means. I had hoped that at least it would remember my user name for the next time that I log in. However, when I log out, I see a message about cookies being removed and one other thing that I... (1 Reply)
Discussion started by: danuke
1 Replies
9. UNIX for Beginners Questions & Answers
Hi all,
I'm new to UNIX world and new to this forum. As I observed there are lot of commands that needs to be remembered in UNIX programming. I'm into DevOps and can anyone please tell me what are all the important commands that are useful for DevOps Engineer.
NOTE: Please correct me if my... (3 Replies)
Discussion started by: maxlink
3 Replies
DOC(4) Kernel Interfaces Manual DOC(4)
NAME
DOC - (Pilot standard text document) file format
SYNOPSIS
struct doc_record0 { /* 16 bytes total */
Word version; /* 1 = plain text, 2 = compressed text */
Word reserved1;
DWord doc_size; /* uncompressed size in bytes */
Word num_recs; /* not counting itself */
Word rec_size; /* in bytes: usually 4096 (4K) */
DWord reserved2;
};
DESCRIPTION
The Doc file format is the standard text document format used by all models of the Palm Pilot. A Doc file is a pdb(4) file: this manual
page describes only those aspects specific to Doc files.
A Doc file consists of 0 to num_recs records; record 0 is the header for the document. (This header is distinct from the pdb(4) header.)
The remaining records contain text, either plain or compressed depending upon version.
Word Sizes
In the synopsis above, the types ``Word'' and ``DWord'' are used just as in the Pilot headers. The type ``Word'' is 16 bits; the type
``DWord'' is 32 bits. Both are in big-endian format.
Compression Format
A character ``c'' in a compressed record is in one of four classes:
01-08 Copy ``c'' bytes
00,09-7F Self
80-BF Sequence
C0-FF A space plus the ASCII character ``c ^ 0x80''
SEE ALSO
txt2pdbdoc(1), html2pdbtxt(1), pdbtxt2html(1), pdb(4)
Christopher Bey and Kathleen Dupre. Palm File Format Specification, Document Number 3008-003, Palm, Inc., May 16, 2000.
AUTHOR
Paul J. Lucas <pauljlucas@mac.com>
txt2pdbdoc January 21, 2005 DOC(4)