Sponsored Content
Top Forums Shell Programming and Scripting Print row if value in column 1 is the first occurence Post 302175991 by agn on Monday 17th of March 2008 04:33:06 AM
Old 03-17-2008
Code:
$ cat buf                                                                                                                                                               
0001 k= 40
0001 k= 2
0002 k= 1
0003 k= 1
0004 k= 77
0004 k= 1
0005 k= 88
0005 k= 6
$ perl -n -e '($num) = split /=/; next if $found[$num]; print; $found[$num] = 1' buf  
0001 k= 40
0002 k= 1
0003 k= 1
0004 k= 77
0005 k= 88

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to print column based on row number

Hi, I want to print column value based on row number say multiple of 8. Input file: line 1 67 34 line 2 45 57 . . . . . . line 8 12 46 . . . . . . line 16 24 90 . . . . . . line 24 49 67 Output 46 90 67 (2 Replies)
Discussion started by: Surabhi_so_mh
2 Replies

2. Shell Programming and Scripting

AWK Script - Print a column - within a Row Range

Hi, Please read the whole thread. I have been working on this script below. It works fine, feel free to copy and test with the INPUT File below as well. example: PACKET DATA PROTOCOL CONTEXT DATA APNID PDPADD EQOSID VPAA PDPCH PDPTY PDPID 10 ... (6 Replies)
Discussion started by: panapty
6 Replies

3. Shell Programming and Scripting

Print the row element till the next row element appear in a column

Hi all I have file with columns F3 pathway CPS F2 H2 H4 H5 H6 no pathway CMP H7 H8 H9 H10 My expected output is F3 pathway CPS F2 pathway CPS (10 Replies)
Discussion started by: Priyanka Chopra
10 Replies

4. Shell Programming and Scripting

Print unique names in each row of a specific column using awk

Is it possible to remove redundant names in the 4th column? input cqWE 100 200 singapore;singapore AZO 300 400 brazil;america;germany;ireland;germany .... .... output cqWE 100 200 singapore AZO 300 400 brazil;america;germany;ireland (4 Replies)
Discussion started by: quincyjones
4 Replies

5. UNIX for Dummies Questions & Answers

awk to print first row with forth column and last row with fifth column in each file

file with this content awk 'NR==1 {print $4} && NR==2 {print $5}' file The error is shown with syntax error; what can be done (4 Replies)
Discussion started by: cdfd123
4 Replies

6. Shell Programming and Scripting

Print every 5 4th column values as separate row with different first column

Hi, I have the following file, chr1 100 200 20 chr1 201 300 22 chr1 220 345 23 chr1 230 456 33.5 chr1 243 567 90 chr1 345 600 20 chr1 430 619 21.78 chr1 870 910 112.3 chr1 914 920 12 chr1 930 999 13 My output would be peak1 20 22 23 33.5 90 peak2 20 21.78 112.3 12 13 Here the... (3 Replies)
Discussion started by: jacobs.smith
3 Replies

7. Shell Programming and Scripting

Print row on 4th column to all row

Dear All, I have input : SEG901 5173 9005 5740 SEG902 5227 5284 SEG903 5284 5346 SEG904 5346 9010 SEG905 5400 5456 SEG906 5456 5511 SEG907 5511 9011 SEG908 5572 9015 SEG909 5622 9020 SEG910 5678 5739 SEG911 5739 5796 SEG912 5796 9025 ... (3 Replies)
Discussion started by: attila
3 Replies

8. Shell Programming and Scripting

Print first row of column a, last row of column b if column a has the same value

I have a table with this structure: cola colb colc 1 19 lemon 20 31 lemon 32 100 lemon 159 205 cherries 210 500 cherries and need to parse it into this format: cola colb colc 1 100 lemon 159 500 cherries So I need the first row of cola and the last row of colb if colc has the... (3 Replies)
Discussion started by: coppuca
3 Replies

9. Shell Programming and Scripting

Print every alternate column in row in a text file

Hi, I have a comma separated file. I would like to print every alternate columns into a new row. Example input file: Name : John, Age : 30, DOB : 30-Oct-2018 Example output: Name,Age,DOB John,30,30-Oct-2018 (3 Replies)
Discussion started by: Lini
3 Replies

10. UNIX for Beginners Questions & Answers

Print a row with the max number in a column

Hello, I have this table: chr1_16857_17742 - chr1 17369 17436 "ENST00000619216.1"; "MIR6859-1"; - 67 chr1_16857_17742 - chr1 14404 29570 "ENST00000488147.1"; "WASH7P"; - 885 chr1_16857_18061 - chr1 ... (5 Replies)
Discussion started by: coppuca
5 Replies
wlmscpfs(1)							    OFFIS DCMTK 						       wlmscpfs(1)

NAME
wlmscpfs - DICOM Basic Worklist Management SCP (based on data files) SYNOPSIS
wlmscpfs [options] port DESCRIPTION
The wlmscpfs application implements a Service Class Provider (SCP) for the Basic Worklist Management Service. The application will listen on a specified TCP/IP port for incoming association requests from a Worklist Management SCU. In case an association was acknowledged and a worklist query was received, the wlmscpfs application will query particular files in a certain directory (which can be specified through corresponding program options) on the file system for corresponding worklist information, and it will send this information back to the calling Worklist Management SCU. Aside from dealing with Worklist Management queries, the wlmscpfs application also supports the Verification Service Class as an SCP. PARAMETERS
port tcp/ip port number to listen on OPTIONS
general options -h --help print this help text and exit --version print version information and exit --arguments print expanded command line arguments -q --quiet quiet mode, print no warnings and errors -v --verbose verbose mode, print processing details -d --debug debug mode, print debug information -ll --log-level [l]evel: string constant (fatal, error, warn, info, debug, trace) use level l for the logger -lc --log-config [f]ilename: string use config file f for the logger multi-process options -s --single-process single process mode --fork fork child process for each association (default) input options general: -dfp --data-files-path [p]ath: string (default: /home/www/wlist) path to worklist data files handling of worklist files: -efr --enable-file-reject enable rejection of incomplete worklist files (default) -dfr --disable-file-reject disable rejection of incomplete worklist files processing options returned character set: -cs0 --return-no-char-set return no specific character set (default) -cs1 --return-iso-ir-100 return specific character set ISO IR 100 -csk --keep-char-set return character set provided in file other processing options: -nse --no-sq-expansion disable expansion of empty sequences in C-FIND request messages network options preferred network transfer syntaxes: +x= --prefer-uncompr prefer explicit VR local byte order (default) +xe --prefer-little prefer explicit VR little endian TS +xb --prefer-big prefer explicit VR big endian TS +xi --implicit accept implicit VR little endian TS only network host access control (tcp wrapper): -ac --access-full accept connections from any host (default) +ac --access-control enforce host access control rules post-1993 value representations: +u --enable-new-vr enable support for new VRs (UN/UT) (default) -u --disable-new-vr disable support for new VRs, convert to OB other network options: -ta --acse-timeout [s]econds: integer (default: 30) timeout for ACSE messages -td --dimse-timeout [s]econds: integer (default: unlimited) timeout for DIMSE messages --max-associations [a]ssocs: integer (default: 50) limit maximum number of parallel associations --refuse refuse association --reject reject association if no implementation class UID --no-fail don't fail on an invalid query --sleep-after [s]econds: integer sleep s seconds after find (default: 0) --sleep-during [s]econds: integer sleep s seconds during find (default: 0) -pdu --max-pdu [n]umber of bytes: integer (4096..131072) set max receive pdu to n bytes (default: 16384) -dhl --disable-host-lookup disable hostname lookup NOTES
The semantic impacts of the above mentioned options is clear for the majority of options. Some particular options, however, are so specific that they need detailed descriptions which will be given in this passage. The returned character set options are intended for situations in which the wlmscpfs application will return attribute values which are not composed of characters from the DICOM default character repertoire. In such cases, for example option --return-iso-ir-100 can be used to specify that a response to a modality's worklist management C-FIND request shall contain DICOM's Specific Character Set attribute (0008,0005) with a corresponding value, indicating the character repertoire from which the characters of returned attribute values were taken (in this example the repertoire ISO IR 100). Please note that the wlmscpfs application will not make sure that all returned values are actually made up of this character repertoire; the application expects this to be the case. In general, the Specific Character Set attribute (0008,0005) will only be included in the C-FIND response if it contains any attributes that are affected by the character set, i.e. for value representations PN, LO, LT, SH, ST and UT. Please note that a C-FIND request which is handled by this application may contain DICOM's Specific Character Set attribute (0008,0005), but this application will never use this attribute's value for matching. Besides, the question if DICOM's Specific Character Set attribute (0008,0005) will be contained in a C-FIND response which is returned by this application is always determined by the returned character set option which was specified when this application was started. The options --enable-file-reject and --disable-file-reject can be used to enable or disable a file rejection mechanism which makes sure only complete worklist files will be used during the matching process. A worklist file is considered to be complete if it contains all necessary type 1 information which the SCP might have to return to an SCU in a C-FIND response message. Table K.6-1 in part 4 annex K of the DICOM standard lists all corresponding type 1 attributes (see column 'Return Key Type'). DICOM Conformance The wlmscpfs application supports the following SOP Classes as an SCP: VerificationSOPClass 1.2.840.10008.1.1 FINDModalityWorklistInformationModel 1.2.840.10008.5.1.4.31 The wlmscpfs application will accept presentation contexts for all of the abovementioned supported SOP Classes using any of the transfer syntaxes: LittleEndianImplicitTransferSyntax 1.2.840.10008.1.2 LittleEndianExplicitTransferSyntax 1.2.840.10008.1.2.1 BigEndianExplicitTransferSyntax 1.2.840.10008.1.2.2 The default behaviour of the wlmscpfs application is to prefer transfer syntaxes having an explicit encoding over the default implicit transfer syntax. If wlmscpfs is running on big-endian hardware it will prefer BigEndianExplicit to LittleEndianExplicit transfer syntax (and vice versa). This behaviour can be changed with the --prefer options (see above). The wlmscpfs application does not support extended negotiation. Currently, the wlmscpfs application supports the following attributes as matching keys: (0008,0050) AccessionNumber (0008,0090) ReferringPhysicianName (0010,0010) PatientName (0010,0020) PatientID (0010,0030) PatientBirthDate (0010,0040) PatientSex (0032,1032) RequestingPhysician (0038,0010) AdmissionID (0040,0100) ScheduledProcedureStepSequence (0008,0060) > Modality (0040,0001) > ScheduledStationAETitle (0040,0002) > ScheduledProcedureStepStartDate (0040,0003) > ScheduledProcedureStepStartTime (0040,0006) > ScheduledPerformingPhysicianName (0040,1001) RequestedProcedureID (0040,1003) RequestedProcedurePriority As return keys the following attributes are currently supported by wlmscpfs: (0008,0050) AccessionNumber (0008,0080) InstitutionName (0008,0081) InstitutionAddress (0008,0090) ReferringPhysicianName (0008,1080) AdmittingDiagnosesDescription (0008,1110) ReferencedStudySequence (0008,1150) > ReferencedSOPClassUID (0008,1155) > ReferencedSOPInstanceUID (0008,1120) ReferencedPatientSequence (0008,1150) > ReferencedSOPClassUID (0008,1155) > ReferencedSOPInstanceUID (0010,0010) PatientName (0010,0020) PatientID (0010,0030) PatientBirthDate (0010,0040) PatientSex (0010,1000) OtherPatientIDs (0010,1001) OtherPatientNames (0010,1020) PatientSize (0010,1030) PatientWeight (0010,1040) PatientAddress (0010,1080) MilitaryRank (0010,2000) MedicalAlerts (0010,2110) ContrastAllergies (0010,2160) EthnicGroup (0010,21a0) SmokingStatus (0010,21b0) AdditionalPatientHistory (0010,21c0) PregnancyStatus (0010,21d0) LastMenstrualDate (0010,4000) PatientComments (0020,000d) StudyInstanceUID (0032,1032) RequestingPhysician (0032,1033) RequestingService (0032,1060) RequestedProcedureDescription (0032,1064) RequestedProcedureCodeSequence (0008,0100) > CodeValue (0008,0102) > CodingSchemeDesignator (0008,0103) > CodingSchemeVersion (0008,0104) > CodeMeaning (0038,0010) AdmissionID (0038,0011) IssuerOfAdmissionID (0038,0050) SpecialNeeds (0038,0300) CurrentPatientLocation (0038,0500) PatientState (0040,0100) ScheduledProcedureStepSequence (0008,0060) > Modality (0032,1070) > RequestedContrastAgent (0040,0001) > ScheduledStationAETitle (0040,0002) > ScheduledProcedureStepStartDate (0040,0003) > ScheduledProcedureStepStartTime (0040,0004) > ScheduledProcedureStepEndDate (0040,0005) > ScheduledProcedureStepEndTime (0040,0006) > ScheduledPerformingPhysicianName (0040,0007) > ScheduledProcedureStepDescription (0040,0008) > ScheduledProtocolCodeSequence (0008,0100) > > CodeValue (0008,0102) > > CodingSchemeDesignator (0008,0103) > > CodingSchemeVersion (0008,0104) > > CodeMeaning (0040,0009) > ScheduledProcedureStepID (0040,0010) > ScheduledStationName (0040,0011) > ScheduledProcedureStepLocation (0040,0012) > PreMedication (0040,0020) > ScheduledProcedureStepStatus (0040,0400) > CommentsOnTheScheduledProcedureStep (0040,1001) RequestedProcedureID (0040,1002) ReasonForTheRequestedProcedure (0040,1003) RequestedProcedurePriority (0040,1004) PatientTransportArrangements (0040,1005) RequestedProcedureLocation (0040,1008) ConfidentialityCode (0040,1009) ReportingPriority (0040,1010) NamesOfIntendedRecipientsOfResults (0040,1400) RequestedProcedureComments (0040,2001) ReasonForTheImagingServiceRequest (0040,2004) IssueDateOfImagingServiceRequest (0040,2005) IssueTimeOfImagingServiceRequest (0040,2008) OrderEnteredBy (0040,2009) OrderEnterersLocation (0040,2010) OrderCallbackPhoneNumber (0040,2016) PlacerOrderNumberImagingServiceRequest (0040,2017) FillerOrderNumberImagingServiceRequest (0040,2400) ImagingServiceRequestComments (0040,3001) ConfidentialityConstraintOnPatientDataDescription The attribute (0008,0005) SpecificCharacterSet is a special case and its support by wlmscpfs is discussed in the NOTES section above. Access Control When compiled on Unix platforms with TCP wrapper support, host-based access control can be enabled with the --access-control command line option. In this case the access control rules defined in the system's host access control tables for wlmscpfs are enforced. The default locations of the host access control tables are /etc/hosts.allow and /etc/hosts.deny. Further details are described in hosts_access(5). LOGGING
The level of logging output of the various command line tools and underlying libraries can be specified by the user. By default, only errors and warnings are written to the standard error stream. Using option --verbose also informational messages like processing details are reported. Option --debug can be used to get more details on the internal activity, e.g. for debugging purposes. Other logging levels can be selected using option --log-level. In --quiet mode only fatal errors are reported. In such very severe error events, the application will usually terminate. For more details on the different logging levels, see documentation of module 'oflog'. In case the logging output should be written to file (optionally with logfile rotation), to syslog (Unix) or the event log (Windows) option --log-config can be used. This configuration file also allows for directing only certain messages to a particular output stream and for filtering certain messages based on the module or application where they are generated. An example configuration file is provided in <etcdir>/logger.cfg). COMMAND LINE
All command line tools use the following notation for parameters: square brackets enclose optional values (0-1), three trailing dots indicate that multiple values are allowed (1-n), a combination of both means 0 to n values. Command line options are distinguished from parameters by a leading '+' or '-' sign, respectively. Usually, order and position of command line options are arbitrary (i.e. they can appear anywhere). However, if options are mutually exclusive the rightmost appearance is used. This behaviour conforms to the standard evaluation rules of common Unix shells. In addition, one or more command files can be specified using an '@' sign as a prefix to the filename (e.g. @command.txt). Such a command argument is replaced by the content of the corresponding text file (multiple whitespaces are treated as a single separator unless they appear between two quotation marks) prior to any further evaluation. Please note that a command file cannot contain another command file. This simple but effective approach allows to summarize common combinations of options/parameters and avoids longish and confusing command lines (an example is provided in file <datadir>/dumppat.txt). ENVIRONMENT
The wlmscpfs utility will attempt to load DICOM data dictionaries specified in the DCMDICTPATH environment variable. By default, i.e. if the DCMDICTPATH environment variable is not set, the file <datadir>/dicom.dic will be loaded unless the dictionary is built into the application (default for Windows). The default behaviour should be preferred and the DCMDICTPATH environment variable only used when alternative data dictionaries are required. The DCMDICTPATH environment variable has the same format as the Unix shell PATH variable in that a colon (':') separates entries. On Windows systems, a semicolon (';') is used as a separator. The data dictionary code will attempt to load each file specified in the DCMDICTPATH environment variable. It is an error if no data dictionary can be loaded. COPYRIGHT
Copyright (C) 1996-2010 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany. Version 3.6.0 6 Jan 2011 wlmscpfs(1)
All times are GMT -4. The time now is 03:35 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy