Sponsored Content
Top Forums Shell Programming and Scripting Disruption of consecutive numbers Post 302794517 by Lucky Ali on Tuesday 16th of April 2013 08:47:44 AM
Old 04-16-2013
Disruption of consecutive numbers

I do have a tab delimited file with the following format

Code:
200 46
201 67
204 89
205 98
206 89
208 890
210 23
..
...

100's of rows

I would like to output the missing consecutive number of the first column.

The expected output will be:
Code:
202
203
207
209

It would be great if I could specify the start and end numbers. Let me know the best way to do this using awk or sed.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Inserting a range of consecutive numbers into a text file

I have a text file in the following format .... START 1,1 2,1 3,1 .. .. 9,1 10,1 END .... I want to change to the output to .... START 1,1 2,1 3,1 .. (4 Replies)
Discussion started by: VNR
4 Replies

2. Shell Programming and Scripting

read numbers from file and output which numbers belongs to which range

Howdy experts, We have some ranges of number which belongs to particual group as below. GroupNo StartRange EndRange Group0125 935300 935399 Group2006 935400 935476 937430 937459 Group0324 935477 935549 ... (6 Replies)
Discussion started by: thepurple
6 Replies

3. Shell Programming and Scripting

Finding consecutive numbers in version names on a txt file

Hi all. I have a directory which contains files that can be versioned. All the files are named according to a pattern like this: TEXTSTRING1-001.EXTENSION TEXTSTRING2-001.EXTENSION TEXTSTRING3-001.EXTENSION ... TEXTSTRINGn-001.EXTENSION If a file is versioned, a file called ... (10 Replies)
Discussion started by: fox1212
10 Replies

4. Shell Programming and Scripting

Print consecutive numbers in column2

Hi, I have an input file of the following style input.txt The 4000 at the end indicates the total no. of columns in that row. I would like to replace all -1s with consecutive 1 and 2 and print the whole line again. So, the output would be output.txt Thanks in advance. (7 Replies)
Discussion started by: jacobs.smith
7 Replies

5. UNIX for Dummies Questions & Answers

Print numbers and associated text belonging to an interval of numbers

##### (0 Replies)
Discussion started by: lucasvs
0 Replies

6. UNIX for Dummies Questions & Answers

How to combine and insert missing consecutive numbers - awk or script?

Hi all, I have two (2) sets of files that are based on some snapshots of database that I want to merge and insert any missing sequential number. Below are example representation of these files: file1: DATE TIME COL1 COL2 COL3 COL4 ID 01/10/2013 0800 100 ... (3 Replies)
Discussion started by: newbie_01
3 Replies

7. Shell Programming and Scripting

Adding the corresponding values for every 5th consecutive numbers

Dear All, I have a file which is as follows: Input File: 231 100.1 233 99 235 200.9 238 80.1 239 90.2 240 77.0 243 99.5 245 16.20 246 13.55 247 11.8 249 13.7 250 99.6 (1 Reply)
Discussion started by: NamS
1 Replies

8. UNIX for Dummies Questions & Answers

Sum every 3 consecutive numbers in a column

Dear All, I have a file with only one column. And I want to add every 3 consecutive numbers together and print the result. Input File: 21.1 10 10 55 11 99 10 8 4 Expected Output: 41.1 (5 Replies)
Discussion started by: NamS
5 Replies

9. UNIX for Beginners Questions & Answers

Decimal numbers and letters in the same collums: round numbers

Hi! I found and then adapt the code for my pipeline... awk -F"," -vOFS="," '{printf "%0.2f %0.f\n",$2,$4}' xxx > yyy I add -F"," -vOFS="," (for input and output as csv file) and I change the columns and the number of decimal... It works but I have also some problems... here my columns ... (7 Replies)
Discussion started by: echo manolis
7 Replies

10. Shell Programming and Scripting

Check/print missing number in a consecutive range and remove duplicate numbers

Hi, In an ideal scenario, I will have a listing of db transaction log that gets copied to a DR site and if I have them all, they will be numbered consecutively like below. 1_79811_01234567.arc 1_79812_01234567.arc 1_79813_01234567.arc 1_79814_01234567.arc 1_79815_01234567.arc... (3 Replies)
Discussion started by: newbie_01
3 Replies
iconv_1251(5)						Standards, Environments, and Macros					     iconv_1251(5)

NAME
iconv_1251 - code set conversion tables for MS 1251 (Windows Cyrillic) DESCRIPTION
The following code set conversions are supported: +-------------------------------------------------------------------------+ | Code Set Conversions Supported | +--------------+--------+--------------+--------+-------------------------+ | Code |Symbol |Target Code |Symbol | Target Output | +--------------+--------+--------------+--------+-------------------------+ |MS 1251 |win5 |ISO 8859-5 |iso5 | ISO 8859-5 Cyrillic | +--------------+--------+--------------+--------+-------------------------+ |MS 1251 |win5 |KOI8-R |koi8 | KOI8-R | +--------------+--------+--------------+--------+-------------------------+ |MS 1251 |win5 |PC Cyrillic |alt | Alternative PC Cyrillic | +--------------+--------+--------------+--------+-------------------------+ |MS 1251 |win5 |Mac Cyrillic |mac | Macintosh Cyrillic | +--------------+--------+--------------+--------+-------------------------+ CONVERSIONS
The conversions are performed according to the following tables. All values in the tables are given in octal. MS 1251 to ISO 8859-5 For the conversion of MS 1251 to ISO 8859-5, all characters not in the following table are mapped unchanged. +-----------------------------------------------------------------+ | | Conversions|Performed | | | MS 1251 | ISO 8859-5 | MS 1251 | ISO 8859-5 | |24 | 4 |310 |270 | |200 | 242 |311 |271 | |201 | 243 |312 |272 | |202 | 40 |313 |273 | |203 | 363 |314 |274 | |204-207 | 40 |315 |275 | |210 | 255 |316 |276 | |211 | 40 |317 |277 | |212 | 251 |320 |300 | |213 | 40 |321 |301 | |214 | 252 |322 |302 | |215 | 254 |323 |303 | |216 | 253 |324 |304 | |217 | 257 |325 |305 | |220 | 362 |326 |306 | |221-227 | 40 |327 |307 | |230 | 255 |330 |310 | |231 | 40 |331 |311 | |232 | 371 |332 |312 | |233 | 40 |333 |313 | |234 | 372 |334 |314 | |235 | 374 |335 |315 | |236 | 373 |336 |316 | |237 | 377 |337 |317 | |241 | 256 |340 |320 | |242 | 376 |341 |321 | |243 | 250 |342 |322 | |244-247 | 40 |343 |323 | |250 | 241 |344 |324 | |251 | 40 |345 |325 | |252 | 244 |346 |326 | |253-254 | 40 |347 |327 | |255 | 55 |350 |330 | |256 | 40 |351 |331 | |257 | 247 |352 |332 | |260-261 | 40 |353 |333 | |262 | 246 |354 |334 | |263 | 366 |355 |335 | |264-267 | 40 |356 |336 | |270 | 361 |357 |337 | |271 | 360 |360 |340 | |272 | 364 |361 |341 | |273 | 40 |362 |342 | |274 | 370 |363 |343 | |275 | 245 |364 |344 | |276 | 365 |365 |345 | |277 | 367 |366 |346 | |300 | 260 |367 |347 | |301 | 261 |370 |350 | |302 | 262 |371 |351 | |303 | 263 |372 |352 | |304 | 264 |373 |353 | |305 | 265 |374 |354 | |306 | 266 |375 |355 | |307 | 267 |376 |356 | +---------------+----------------+----------------+---------------+ MS 1251 to KOI8-R For the conversion of MS 1251 to KOI8-R , all characters not in the following table are mapped unchanged. +-----------------------------------------------------------------+ | | Conversions|Performed | | | MS 1251 | KOI8-R | MS 1251 | KOI8-R | |24 | 4 |310 |351 | |200 | 261 |311 |352 | |201 | 262 |312 |353 | |202 | 40 |313 |354 | |203 | 242 |314 |355 | |204-207 | 40 |315 |356 | |210 | 255 |316 |357 | |211 | 40 |317 |360 | |212 | 271 |320 |362 | |213 | 40 |321 |363 | |214 | 272 |322 |364 | |215 | 274 |323 |365 | |216 | 273 |324 |346 | |217 | 277 |325 |350 | |220 | 241 |326 |343 | |221-227 | 40 |327 |376 | |230 | 255 |330 |373 | |231 | 40 |331 |375 | |232 | 251 |332 |377 | |233 | 40 |333 |371 | |234 | 252 |334 |370 | |235 | 254 |335 |374 | |236 | 253 |336 |340 | |237 | 257 |337 |361 | |241 | 276 |340 |301 | |242 | 256 |341 |302 | |243 | 270 |342 |327 | |244-247 | 40 |343 |307 | |250 | 263 |344 |304 | |251 | 40 |345 |305 | |252 | 264 |346 |326 | |253-254 | 40 |347 |332 | |255 | 55 |350 |311 | |256 | 40 |351 |312 | |257 | 267 |352 |313 | |260-261 | 40 |353 |314 | |262 | 266 |354 |315 | |263 | 246 |355 |316 | |264-267 | 40 |356 |317 | |270 | 243 |357 |320 | |271 | 260 |360 |322 | |272 | 244 |361 |323 | |273 | 40 |362 |324 | |274 | 250 |363 |325 | |275 | 265 |364 |306 | |276 | 245 |365 |310 | |277 | 247 |366 |303 | |300 | 341 |367 |336 | |301 | 342 |370 |333 | |302 | 367 |371 |335 | |303 | 347 |372 |337 | |304 | 344 |373 |331 | |305 | 345 |374 |330 | |306 | 366 |375 |334 | |307 | 372 |376 |300 | +---------------+----------------+----------------+---------------+ MS 1251 to PC Cyrillic For the conversion of MS 1251 to PC Cyrillic, all characters not in the following table are mapped unchanged. +-----------------------------------------------------------------+ | | Conversions|Performed | | | MS 1251 | PC Cyrillic | MS 1251 | PC Cyrillic | |24 | 4 |332 |232 | |200-207 | 40 |333 |233 | |210 | 260 |334 |234 | |211-227 | 40 |335 |235 | |230 | 260 |336 |236 | |231-247 | 40 |337 |237 | |250 | 360 |340 |240 | |251-254 | 40 |341 |241 | |255 | 55 |342 |242 | |256-267 | 40 |343 |243 | |270 | 361 |344 |244 | |271-277 | 40 |345 |245 | |300 | 200 |346 |246 | |301 | 201 |347 |247 | |302 | 202 |350 |250 | |303 | 203 |351 |251 | |304 | 204 |352 |252 | |305 | 205 |353 |253 | |306 | 206 |354 |254 | |307 | 207 |355 |255 | |310 | 210 |356 |256 | |311 | 211 |357 |257 | |312 | 212 |360 |340 | |313 | 213 |361 |341 | |314 | 214 |362 |342 | |315 | 215 |363 |343 | |316 | 216 |364 |344 | |317 | 217 |365 |345 | |320 | 220 |366 |346 | |321 | 221 |367 |347 | |322 | 222 |370 |350 | |323 | 223 |371 |351 | |324 | 224 |372 |352 | |325 | 225 |373 |353 | |326 | 226 |374 |354 | |327 | 227 |375 |355 | |330 | 230 |376 |356 | |331 | 231 | | | +---------------+----------------+----------------+---------------+ MS 1251 to Mac Cyrillic For the conversion of MS 1251 to Mac Cyrillic, all characters not in the following table are mapped unchanged. +-----------------------------------------------------------------+ | | Conversions|Performed | | | MS 1251 | Mac Cyrillic | MS 1251 | Mac Cyrillic | |24 | 4 |260 |241 | |200 | 253 |262 |247 | |201 | 256 |263 |264 | |202 | 40 |264 |266 | |203 | 257 |266 |246 | |204 | 327 |267 |245 | |205 | 311 |270 |336 | |206 | 240 |271 |334 | |207-211 | 40 |272 |271 | |212 | 274 |273 |310 | |213 | 40 |274 |300 | |214 | 276 |275 |301 | |215 | 315 |276 |317 | |216 | 40 |277 |273 | |217 | 332 |300 |200 | |220 | 254 |301 |201 | |221 | 324 |302 |202 | |222 | 325 |303 |203 | |223 | 322 |304 |204 | |224 | 323 |305 |205 | |225 | 40 |306 |206 | |226 | 320 |307 |207 | |227 | 321 |310 |210 | |230 | 40 |311 |211 | |231 | 252 |312 |212 | |232 | 275 |313 |213 | |233 | 40 |314 |214 | |234 | 277 |315 |215 | |235 | 316 |316 |216 | |236 | 40 |317 |217 | |237 | 333 |320 |220 | |240 | 312 |321 |221 | |241 | 330 |322 |222 | |242 | 331 |323 |223 | |243 | 267 |324 |224 | |244 | 377 |325 |225 | |245 | 242 |326 |226 | |246 | 40 |327 |227 | |247 | 244 |330 |230 | |250 | 335 |331 |231 | |252 | 270 |332 |232 | |253 | 307 |333 |233 | |254 | 302 |334 |234 | |255 | 55 |335 |235 | |256 | 250 |336 |236 | |257 | 272 |337 |237 | |355 | 316 | | | +---------------+----------------+----------------+---------------+ FILES
/usr/lib/iconv/*.so conversion modules /usr/lib/iconv/*.t conversion tables /usr/lib/iconv/iconv_data list of conversions supported by conversion tables SEE ALSO
iconv(1), iconv(3C), iconv(5) SunOS 5.10 18 Apr 1997 iconv_1251(5)
All times are GMT -4. The time now is 10:46 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy