Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Parsing a variable length record Post 56245 by Barb on Wednesday 29th of September 2004 11:41:06 AM
Old 09-29-2004
Well it almost worked. The problem I'm having is that some of the data wraps around multiple lines and for them it's pulling blanks. The 3rd and 5th lines in the sample text show the problem. I need the 5th field and on alot of the records it's just not there. The only things I can figure out to tell it it's a multiple line record require the same character in the first position of a line. Any ideas? ^Smilie

856^18530001~BSN^14^486165^040927^181323^0004~NTE^856^18530002~BSN^14^486399^040927^181323^0004~NTE^
856^18
856^18530004~BSN^14^489012^040927^181323^0004~NTE^
856^18530005~BSN^1
856^18540001~BSN^14^488594^040927^181941^0004~NTE^
856^18540002~BSN^14^489016^040927^181941^0004~NTE^
856^18550001~BSN^14^488567^040927^182539^0004~NTE^
856^18550002~BSN^14^489102^040927^182539^0004~NTE^
856^18560001~BSN^14^484633^040927^183156^0004~NTE^Smilie
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Parsing data and retaining the full length of variable

Here's is an example of what I want to do: var1="Horse " var2="Cat " var3="Fish " for animals in "$var1" "$var2" "$var3" do set $animals pet=$1 ## Ok, now I want to get the values of $pet, but ## I want to retain the full length it was... (3 Replies)
Discussion started by: app4dxh
3 Replies

2. Shell Programming and Scripting

creating a fixed length output from a variable length input

Is there a command that sets a variable length? I have a input of a variable length field but my output for that field needs to be set to 32 char. Is there such a command? I am on a sun box running ksh Thanks (2 Replies)
Discussion started by: r1500
2 Replies

3. Shell Programming and Scripting

Pivot variable record length file and change delimiter

Hi experts. I got a file (500mb max) and need to pivot it (loading into ORCL) and change BLANK delimiter to PIPE |. Sometimes there are multipel BLANKS (as a particular value may be BLANK, or simply two BLANKS instead of one BLANK). thanks for your input! Cheers, Layout... (3 Replies)
Discussion started by: thomasr
3 Replies

4. UNIX for Dummies Questions & Answers

What the command to find out the record length of a fixed length file?

I want to find out the record length of a fixed length file? I forgot the command. Any body know? (9 Replies)
Discussion started by: tranq01
9 Replies

5. Shell Programming and Scripting

Parsing a variable length file

Hi I am new to shell scripting. I need to parse a file which contains the header and detail records and split into n of file based on dept ID, for ex. INPUT FILE: DEPT ID: 1 EMPNAME: XYZ EMPAddress: XYZZZ DEPT ID: 2 EMPNAME: ABC EMPAddress: ABCD DEPT ID: 1 EMPNAME: PQR EMPAddress:... (6 Replies)
Discussion started by: singhald
6 Replies

6. Shell Programming and Scripting

Check length of record

Hi, I have a problem, please help me, I have a flat file like this: P00000000088888888999999999 0000999903 000000000000000000 P00000000077777777000000000 0000999903 000000000000000000 P00000000044444444333333333 0000999903 00000000000000000079875 P00000000066666666111111111 0000999903 ... (5 Replies)
Discussion started by: DebianJ
5 Replies

7. Shell Programming and Scripting

Make variable length record a fixed length

Very, very new to unix scripting and have a unique situation. I have a file of records that contain 3 records types: (H)eader Records (D)etail Records (T)railer Records The Detail records are 82 bytes in length which is perfect. The Header and Trailer records sometimes are 82 bytes in... (3 Replies)
Discussion started by: jclanc8
3 Replies

8. Shell Programming and Scripting

changing a variable length text to a fixed length

Hi, Can anyone help with a effective solution ? I need to change a variable length text field (between 1 - 18 characters) to a fixed length text of 18 characters with the unused portion, at the end, filled with spaces. The text field is actually field 10 of a .csv file however I could cut... (7 Replies)
Discussion started by: dc18
7 Replies

9. Shell Programming and Scripting

Record length

Hi, The record length may be differ in afile. I want to display the records if the record length is not equal to 50 using sed/awk command. Thanks in Advance (6 Replies)
Discussion started by: NareshN
6 Replies

10. Shell Programming and Scripting

Convert variable length record to fixed length

Hi Team, I have an issue to split the file which is having special chracter(German Char) using awk command. I have a different length records in a file. I am separating the files based on the length using awk command. The command is working fine if the record is not having any... (7 Replies)
Discussion started by: Anthuvan
7 Replies
BCHARGE(1)						      General Commands Manual							BCHARGE(1)

NAME
bcharge - program to set BlackBerry handhelds to 500mA SYNOPSIS
bcharge DESCRIPTION
bcharge is a program that sends a special handshake to all BlackBerry devices it finds on the USB bus. This handshake causes the device to reset itself, and then request 500mA instead of the usual 100mA. This allows proper charging on Linux. It is safe to run this command multiple times, as it only changes devices that are not already set to 500mA, or are not in the desired mode. OPTIONS
-o For Blackberry Pearl devices, using this switch causes bcharge to set the Product ID to 0001. When the Pearl is in 0004 mode, two USB interfaces are presented: one for database access and one for mass storage. In 0001 mode, only the database access is available. Before bcharge is run, the Pearl shows up with a Product ID of 0006, which only gives mass storage functionality. You must run bcharge for the Pearl before using btool. -d This switch is for the Blackberry Pearl to switch it back to 0004 dual mode after having run bcharge with the -o option. Alter- nately, newer devices (such as Storm with product ID of 8007) will be switched to 0004. Since a Pearl in mode 0001 is practically indistinguishable from a classic Blackberry, the -d switch is needed to tell bcharge that you really are working with a Pearl. -g Guess whether Dual mode is needed. If USB Interface Class 255 is not found on the device (the class used for database access), then dual mode is set. Otherwise, the device is left as is. -h Help summary. -p devpath If your system runs a kernel with CONFIG_USB_SUSPEND enabled (some Ubuntu kernels have this turned on, as well as some Fedora 7 ker- nels), then you also need to adjust the suspend state to avoid going into power saving mode. This option is used when run from udev, using a rule such as: BUS=="usb", SUBSYSTEM=="usb_device", ACTION=="add", SYSFS{idVendor}=="0fca", SYSFS{idProduct}=="0001", SYMLINK+="bb-%k", GROUP="plugdev", MODE="0660", RUN="/usr/sbin/bcharge -p %p" When using this option, you will almost always need to be root. -s path Specify the mount point for the sysfs filesystem. On most systems this is mounted at /sys which is the default. AUTHOR
bcharge and this manual page were written by Chris Frey <cdfrey@foursquare.net> for the Barry project. http://www.netdirect.ca/software/packages/barry October 7, 2010 BCHARGE(1)
All times are GMT -4. The time now is 03:37 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy