I need a simple nawk, awk, or sed program (or anything else, really) that will count the number of pipe characters in a file. So, if my file looks like this:
222222222222222|2222|2222|222222|||
|222222|222|222222222222||222|
|||22222222|222222222|2|||222222222222|
I need the program to return...
I have a pipe-delimited file with 24 fields. It is sorted on the 24th field. I need a program (or command, awk, nawk, whatever) that will go record-by-record, and flag every record where the 24th field is the same as the previous record AND field 19 is DIFFERENT (from the previous record)...
Hi. I have a fixed width file, that is 62 bytes wide. The first 50 bytes are irrelevant to me. Bytes 51-62 are what I'm interested in, here. Starting in position 51, there is a number that is one to 12 bytes wide. I want to alter the file, padding any non-12-byte number with zeros, to fill...
Hello, I have a question that someone here, hopefully, can answer...
My project team at work is developing a java-based product that will automatically send email messages, SMS messages, and MMS messages in real-time. We are dealing with brokers to handle the sending and receiving of email...
I have a fixed-width file that contains records that are 20-bytes long, and 12 of those bytes make up an "individual id" field. the remaining 8 bytes contain "other" information. The "individual id" may or may not be unique across records. So, for example, the contents of my file might look...
I need to select certain records from a file. The records are pipe-delimited, and therefore variable-length. The last two fields on the record are the onew I am concerned with. I want to pull records where the 2nd-to-last field = 'Y', and the last field = 'N'. For example, out of these four...
I have an easy to semi-difficult problem here, and I was wondering if any of the good people at Tek-Tips could help me out... Here goes:
I have two files (File A and File B), each have records that are 100 bytes in length. There are 12-digit "keys" on each file, in positions 1-12. File A is...
I have a file that conatains roughly 700,000 records. I need a quick way to append two pipe characters to the end of each record. So, If input looks like this:
aaa|bbb|ccc
aaaa|bbbb|cccc
nnnnnnnnnnnnnnnnn
Output needs to look like this:
aaa|bbb|ccc||
aaaa|bbbb|cccc||
nnnnnnnnnnnnnnnnn||...
I need to run something ('awk', 'sed', etc.) that will let me know what the longest record in a file is. And I need it to ignore spaces. So, if I have a file with records that look like this (without the ticks):
'John Doe'
'Al Doe'
'Christopher Doe'
'Jill Doe'
I want the returned result to...
Very easy question here:
I have a file that contains pipe-delimited data.
I need to insert a header record, without overwriting any data records. So, if the input file looks like this:
John Doe|123 Main St|New York|NY|10101
Jane Doe|456 Oak St|Chicago|IL|12345
I need the output file to...
Hi All...
I have what is probably a very easy question for the experts that patrol this board...
I have a fixed-width file with four 10-byte fields (field 1 = bytes 1-10, field 2 = bytes 11-20, field 3 = bytes 21-30, field 4 = bytes 31-40). Some of the fixed-width fields contain no spaces, or...
OK. Here's my dilemma... I have a file with a bunch of 12-byte "ID's" on it. It looks like this:
111111111111
999999999999
222222222222
999999999999
333333333333
222222222222
...and so on.
Anyway, here's the criteria: I want to take this file, do "something" to it, and, when that...
If I have a file where all of the records have trailing spaces... like this (without the single quotes):
'123 Main '
'456 Central Ave '
'789 Oak Street '
How do I take this file, and strip the trailing spaces, so my output looks like this (without the single quotes):
'123 Main'...
Hi... What's the best way to pull a record from a file if certain bytes match a string? For example, I have a fixed-width file that has a state code in the 200-201 byte of each record. I want to pull all records where state code = 'CA' 'NY' 'NJ' or 'FL', and put them into a new file. How do...
Hi... I have a fixed-length file, and I need to append a 38-byte sequence id (starting with '00000000000000000000000000000000000001') to the beginning of each record. I know there is an easy way to do this using a korn shell script, but I can't remember it. Can anyone help me out here? Thanks!
I'm creating a Word document that will be used for requirements gathering. There are several sections the end user will be required to fill out ("Specifications", "Constraints", etc.). I want to try something, and I'm not sure it's possible. Under each section heading, I want to provide the...
I have a document I'm trying to put together using MS Word 2002. In the top fifth of the document, I have a table structure, containing some fill-in forms ("Name", "Date", etc.). In the bottom 4/5 of the document, I have no real formatting, but I do have section header names ("Requirements"...
I'm trying to write a .ksh script that will take an input file that contains records that are 10 bytes long, and then, based on the first character, append an eleventh character. If the first character of the record = 'H', I want the script to append an 'A' to the end of the record (as byte...
Hi... I have a file that contains name and address information. The primary address appears from byte 116-150. I need to pull all records off of that file where primary address is NOT blank, and put them into a new file. Can anyone help me out here???
I have a file that contains a 10 byte sequence number, followed by a 1 to 3 byte segment id. My file looks like this (without the single quotes):
'1234567890A'
'0987654321BB'
'1111111111CCC'
So, as you see, some records are 11 bytes in width, some are 12, and some are 13.
I want to use...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.