Sponsored Content
Top Forums Shell Programming and Scripting Variable Sized Array Length Question Post 302361603 by methyl on Tuesday 13th of October 2009 04:03:05 PM
Old 10-13-2009
Can you post:
1) The format of the original file with sample data, making it clear whether there are field delimiters and which field is the "ID".
2) Estimate the maximum number of IDs.
3) Sample IDs - expecially if they are variable length and could be contained within another ID (e.g. "foobar" and "myfoobar")
 

10 More Discussions You Might Find Interesting

1. 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

2. UNIX for Dummies Questions & Answers

Convert a tab delimited/variable length file to fixed length file

Hi, all. I need to convert a file tab delimited/variable length file in AIX to a fixed lenght file delimited by spaces. This is the input file: 10200002<tab>US$ COM<tab>16/12/2008<tab>2,3775<tab>2,3783 19300978<tab>EURO<tab>16/12/2008<tab>3,28523<tab>3,28657 And this is the expected... (2 Replies)
Discussion started by: Everton_Silveir
2 Replies

3. 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

4. Shell Programming and Scripting

Split variable length and variable format CSV file

Dear all, I have basic knowledge of Unix script and her I am trying to process variable length and variable format CSV file. The file length will depend on the numbers of Earnings/Deductions/Direct Deposits. And The format will depend on whether it is Earnings/Deductions or Direct Deposits... (2 Replies)
Discussion started by: chechun
2 Replies

5. 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

6. Programming

Does ansi c support variable-length array?

I successfully compiled code like below. #include<stdio.h> #include<string.h> int main() { int co = 9; char a; strcpy(a, "hahahah"); printf("co=%d\n", co); printf("a=%s\n", a); return 0; } (7 Replies)
Discussion started by: vistastar
7 Replies

7. Shell Programming and Scripting

Array Length Reports as Having Length when it is Empty?

Hello All, I have this script that does stuff like "starting, stopping & restarting" a Daemon Process running on my machine... My main question is why in part of my code (which you will see below) does the Array Length (i.e. ${#PIDS} ) return "1" when I know the Array is empty..? Here is... (17 Replies)
Discussion started by: mrm5102
17 Replies

8. Shell Programming and Scripting

[Solved] How to increment and add variable length numbers to a variable in a loop?

Hi All, I have a file which has hundred of records with fixed number of fields. In each record there is set of 8 characters which represent the duration of that activity. I want to sum up the duration present in all the records for a report. The problem is the duration changes per record so I... (5 Replies)
Discussion started by: danish0909
5 Replies

9. Shell Programming and Scripting

Bash question: working with an array of previously set variable strings

while i've used arrays to work with variables, i've never used them to loop through a set of strings and wanted to ask the community for some feedback or assistance. let me be specific. here's my code: # URL port Variables port2195=`nc -z $url2195 2195` port2196=`nc -z $url2196 2196`... (5 Replies)
Discussion started by: hungryd
5 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
IEEE1284_GET_DEVICEI(3) 					     Functions						   IEEE1284_GET_DEVICEI(3)

NAME
ieee1284_get_deviceid - retrieve an IEEE 1284 Device ID SYNOPSIS
#include <ieee1284.h> ssize_t ieee1284_get_deviceid(struct parport *port, int daisy, int flags, char *buffer, size_t len); DESCRIPTION
This function is for retrieving the IEEE 1284 Device ID of the specified device. The device is specified by the port to which it is attached, and optionally an address (daisy) on the daisy chain of devices on that port. daisy should be -1 to indicate that the device is not participating in a IEEE 1284.3 daisy chain, meaning it is the last (or only) device on the port, or should be a number from 0 to 3 inclusive to indicate that it has the specified daisy chain address (0 is next to the port). The flags parameter should be a bitwise union of any flags that the program wants to use. Available flags are: F1284_FRESH Guarantee a fresh Device ID. A cached or OS-provided ID will not be used. The provided buffer must be at least len bytes long, and will contain the Device ID including the initial two-byte length field and a terminating zero byte on successful return, or as much of the above as will fit into the buffer. RETURN VALUE
A return value less than zero indicates an error as below. Otherwise, the return value is the number of bytes of buffer that have been filled. A return value equal to the length of the buffer indicates that the Device ID may be longer than the buffer will allow. E1284_NOID The device did not provide an IEEE 1284 Device ID when interrogated (perhaps by the operating system if F1284_FRESH was not specified). E1284_NOTIMPL One or more of the supplied flags is not supported in this implementation, or if no flags were supplied then this function is not implemented for this type of port or this type of system. This can also be returned if a daisy chain address is specified but daisy chain Device IDs are not yet supported. E1284_NOTAVAIL F1284_FRESH was specified and the library is unable to access the port to interrogate the device. E1284_NOMEM There is not enough memory. E1284_INIT There was a problem initializing the port. E1284_INVALIDPORT The port parameter is invalid. NOTES
Unless the F1284_FRESH flag is given, the library will try to find the device's ID as unobtrusively as possible. First it will ask the operating system if it knows it, and then it will try actually asking the device for it. Because of this, the Device ID may be partially computed (the length field, for example) or even partially missing if the operating system has only remembered some parts of the ID. To guarantee that you are getting the bytes that the device sent, use F1284_FRESH. Be aware that the operating system may allow any user to inspect the Device IDs that it provides, whereas device access is normally more restricted. The initial two-byte length field is a big-endian 16 bit unsigned integer provided by the device and may not be accurate. In particular, it is meant to indicate the length of the entire string including the length field itself; however, some manufacturers exclude the length field or just set the length field to some arbitrary number greater than the ID length. AUTHOR
Tim Waugh <twaugh@redhat.com> Author. COPYRIGHT
Copyright (C) 2001-2003 Tim Waugh 09/18/2007 IEEE1284_GET_DEVICEI(3)
All times are GMT -4. The time now is 09:01 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy