Explain if a flat file cotains 1000 records how can I get first and last records only?



Explain if a flat file cotains 1000 records how can I get first and last records only?..

Answer / Ramesh Bhagat

To get the first and last records from a flat file with 1000 records, you can use the head and tail commands in Unix or Linux. The head command shows the first n lines of a file (by default, it shows the first 10 lines), while the tail command shows the last n lines (by default, it shows the last 10 lines). To get only the first record, you can use head -n 1, and to get only the last record, you can use tail -n +999 (assuming that records are numbered starting from 1).

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Data Warehouse General Interview Questions

What's a Cube in Rolap?

2 Answers   Oracle,


Hi, Could any one tell me which schema (star and snow flake schema) will take much space? Thanks S.A.K

6 Answers   Accenture, IBM, TCS,


What are data validation strategies for data mart validation after loading process?

1 Answers  


What are partition points?

1 Answers  


When should one use an MD-database (multi-dimensional database) and not a relational one?

2 Answers   IBM,


Where we use surrogate key explain with example?

1 Answers  


What are the advantages of cold fusion?

1 Answers  


What are the advantages of raid 1, 1/0, and

1 Answers  


What are the reasons to use a chameleon method in data warehousing?

1 Answers  


What are the stages that are required in data warehousing?

1 Answers  


How can we do data cleaning?

1 Answers  


How to create prompts in report net?

1 Answers  


Categories