There are two file are there .1st file contains 5 records and
2nd file contain 10 records in target they want 50 records.how
can achieve this
Answer Posted / Rishabh Kumar Kashyap
To combine the contents of two files with a total of 50 records, you can use a script or command depending on the operating system and specific tools available. Here is an example using Unix-based systems like Linux:
1. First, concatenate the two files using the `cat` command:
```bash
cat file1.txt file2.txt > combined.txt
```
2. Next, append the required number of empty lines to the combined file using the `sed` command:
```bash
sed -i '$an' combined.txt
```
3. Repeat step 2 until you have the desired number of empty lines (in this case, 40 times).
4. Now, generate 5 more records using a tool like `echo` and append them to the end of the file:
```bash
for i in {1..5}; do echo "Record $i" >> combined.txt; done
```
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Demonstrate experience in maintaining quality process standards?
Have you have ever worked in unix environment and why it is useful in datastage?
create a job that splits the data in the Jobs.txt file into
four output files. You will direct the data to the
different output files using constraints. • Job name:
JobLevels
• Source file: Jobs.txt
• Target file 1: LowLevelJobs.txt
− min_lvl between 0 and 25 inclusive.
− Same column types and headings as Jobs.txt.
− Include column names in the first line of the output file.
− Job description column should be preceded by the
string “Job
Title:” and embedded within square brackets. For example, if
the job description is “Designer”, the derived value
is: “Job
Title: [Designer]”.
• Target file 2: MidLevelJobs.txt
− min_lvl between 26 and 100 inclusive.
− Same format and derivations as Target file 1.
• Target file 3: HighLevelJobs.txt
− min_lvl between 101 and 500 inclusive.
− Same format and derivations as Target file 1.
• Rejects file: JobRejects.txt
− min_lvl is out of range, i.e., below 0 or above 500.
− This file has only two columns: job_id and reject_desc.
− reject_desc is a variable-length text field, maximum
length
100. It should contain a string of the form: “Level out of
range:
1)what is the size of Fact table and dimension table? 2)how to find the size of Fact table and dimension table? 3)how to implement the surrogate key in transform stage? 4)write the configuration file path? 5)how many types of datasets explain? 6)diff b/w developed projects and migration projects? 7)how to delete the header and footer file of the sequencer file? 8)how can u call the parameters in DS in unix environment? 9) how much data ur getting daily ? 10)
Source has 2 columns: USA,NewYork INDIA,MUMBAI INDIA,DELHI UDS,CHICAGO INDIA,PUNE i want data in target like below: INDIA,MUMBAI1 INDIA,DELHI2 INDIA,PUNE3 USA,NEWYORK1 USA,CHICAGO2
1)s.key generate 1 to 700 records today. tomorrow another 400 will updated how to update the records using s.key generator? 2)source is like :-- DB --> T/F stage1 --> seq1file T/f 1 is linking with T/F2 ---> seq 2 how to load the data? in source i given some conditions those r going in seq1. The another data will going to seq2 how to do this ?