Sponsored Content
Top Forums UNIX for Advanced & Expert Users Convert variable blocked file Post 302770776 by DGPickett on Monday 18th of February 2013 10:00:04 AM
Old 02-18-2013
Fixed block means no line feeds or other record separatorsn, just N bytes. It may have binary data, too. Variable comes in many forms. New-line is not the only record separator, and field separators vary too: comma, tab, pipe, ??? never mind XML with its hierarchy of container/leaf elements and their attributes. Fields in fixed block are also usually by length (they can be delimited and then padded, but that is sort of a mix of flavors), in which case you need to know the layout. The file is easily handled as an array of C/C++ struct that you can mmap() and then everything is field delimited by length and record count. You might need a union for the layout of headers and trailers, and any variant record types in the file.

Look it over in a tool that is not too line feed oriented, like pg, more, od.
 

10 More Discussions You Might Find Interesting

1. IP Networking

BitTorrent port 6969 blocked... how to get around the blocked port

Due to the massive Upload speeds killing .... or overstressing our schools network...... my school has blocked port 6969 (the most common BitTorrent port). So I cant connect to the tracker anymore, in other words no more downloading from school :( Does anyone know how I can get around the ports... (1 Reply)
Discussion started by: PenguinDevil
1 Replies

2. Shell Programming and Scripting

How do you take what a user types in and convert it into a variable to be used

I am a newbie to programming on the unix Command Line*, and was wondering how you take what a user types in and convert it into a variable to be used in the script? *I always used it for file editing, but nothing more. Then I began to use BBedit. :confused: (1 Reply)
Discussion started by: signebedi
1 Replies

3. Shell Programming and Scripting

convert variable content to array

Hi All, I have a variable in a shell script which holds let say n paarmeteres with space separate them : $var = par1 par2 par3 par4 parn; so if I print this variable this is what I'll see: par1 par2 par3 par4 parn I need to insert each parameter to an array , so I can go over on each... (3 Replies)
Discussion started by: Alalush
3 Replies

4. UNIX for Dummies Questions & Answers

Convert Variable file to fixed file.

I have a set of variable date log files /tmp/test/test1_<YYYYMMDD>_A.log /tmp/test/test2_<YYYYMMDD>_B.log /tmp/test/test3_<YYYYMMDD>_C.log /tmp/test/test4_<YYYYMMDD>_D.log /tmp/test/test5_<YYYYMMDD>_E.log which should be converted (should have content of all the above listed files) into... (1 Reply)
Discussion started by: abhi9845
1 Replies

5. Shell Programming and Scripting

Convert Variable file to fixed file.

I have a set of variable date log files /tmp/test/test1_<YYYYMMDD>_A.log /tmp/test/test2_<YYYYMMDD>_B.log /tmp/test/test3_<YYYYMMDD>_C.log /tmp/test/test4_<YYYYMMDD>_D.log /tmp/test/test5_<YYYYMMDD>_E.log which should be converted (should have content of all the above listed files) into... (9 Replies)
Discussion started by: abhi9845
9 Replies

6. Shell Programming and Scripting

convert date variable to doy variable

Hello: I have a script that requires the use of DOY (as a variable) instead of YY/MM/DD. I already obtained these parameters from downloaded files and stored them as variables (i.e. $day, $month, $year). Is there any simple script that I could incorporate in mine to do this job? Regards, ... (8 Replies)
Discussion started by: aabrego
8 Replies

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

8. Shell Programming and Scripting

convert hex to binary and send to variable

Folks, can anyone help with a script to convert hex to binary digits, and break the 32 bit binary into packs of 4 and send them to 8 different variables.Any help is sincerely appreciated. Thanks venu Its in korn shell...... (24 Replies)
Discussion started by: venu
24 Replies

9. Shell Programming and Scripting

Blocked while Redirecting the syslog messages to a pipe in the rc script file

Hi All, I am newbie to linux and i am trying to re-direct the syslog messages to a pipe. I have modified the syslog.conf file accordingly and have written an rc script to read from the pipe and put them to a file. I was able to get the log messages to the file but my system is getting ... (1 Reply)
Discussion started by: anilmurala
1 Replies

10. Shell Programming and Scripting

Read Variable From Fille And Convert it to Integer

I read 3 variables from from Inputfile.txt the third one "startnumber" is a number when i compare it with 9 ($startnumber -le 9) it give's me a "unary operator expected", i know that -le is for number comparison. What i need is to convert $startnumber to integer (i have try to do it with expr but... (8 Replies)
Discussion started by: marios
8 Replies
pthread_cond_signal(3C) 												   pthread_cond_signal(3C)

NAME
pthread_cond_signal, pthread_cond_broadcast - signal or broadcast a condition SYNOPSIS
cc -mt [ flag... ] file... -lpthread [ library... ] #include <pthread.h> int pthread_cond_signal(pthread_cond_t *cond); int pthread_cond_broadcast(pthread_cond_t *cond); These two functions are used to unblock threads blocked on a condition variable. The pthread_cond_signal() call unblocks at least one of the threads that are blocked on the specified condition variable cond (if any threads are blocked on cond). The pthread_cond_broadcast() call unblocks all threads currently blocked on the specified condition variable cond. If more than one thread is blocked on a condition variable, the scheduling policy determines the order in which threads are unblocked. When each thread unblocked as a result of a pthread_cond_signal() or pthread_cond_broadcast() returns from its call to pthread_cond_wait() or pthread_cond_timedwait(), the thread owns the mutex with which it called pthread_cond_wait() or pthread_cond_timedwait(). The thread(s) that are unblocked contend for the mutex according to the scheduling policy (if applicable), and as if each had called pthread_mutex_lock(). The pthread_cond_signal() or pthread_cond_broadcast() functions may be called by a thread whether or not it currently owns the mutex that threads calling pthread_cond_wait() or pthread_cond_timedwait() have associated with the condition variable during their waits; however, if predictable scheduling behavior is required, then that mutex is locked by the thread calling pthread_cond_signal() or pthread_cond_broad- cast(). The pthread_cond_signal() and pthread_cond_broadcast() functions have no effect if there are no threads currently blocked on cond. If successful, the pthread_cond_signal() and pthread_cond_broadcast() functions return 0. Otherwise, an error number is returned to indi- cate the error. The pthread_cond_signal() and pthread_cond_broadcast() function may fail if: EINVAL The value cond does not refer to an initialized condition variable. See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ |MT-Level |MT-Safe | +-----------------------------+-----------------------------+ pthread_cond_init(3C), pthread_cond_wait(3C), pthread_cond_timedwait(3C), attributes(5), condition(5), standards(5) 23 Mar 2005 pthread_cond_signal(3C)
All times are GMT -4. The time now is 12:20 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy