User can upload two types of files data . Please find the sample data below

```
Sample 1:

Name    mobile  url message text
test11  1234567890  www.example.com  "Data Test New
Date:27/02/2020
Items: 1
Total: 3
Regards
ABC DATa
Ph:091 : 123456789"
test12  1234567891   www.example.com  hello

Sample2

test12  1234567891   www.example.com  hello
test13  1234567892   www.example.com  hi
test14  1234567893   www.example.com  hi

```

User file can have 2-3 millions of records . So I want to give preview option to the user where user can preview first 10 lines of their uploaded file. To get first 10 lines I am using below command

```
awk -v RS='"[^"]*"' 'NR>10{exit} {gsub(/\r?\n/, "\\n", RT); ORS=RT} 1' test.csv 

```

it works perfectly when files rows have double value but for sample 2 it is printing all the records from file.

Below command is working for sample 2 but not for sample 1

```
head -n10 test.csv | tr '^' ','

```

Excpected Output:

```
Sample1:

Name    mobile  url message text
test11  1234567890  www.example.com  "Data Test New\nDate:27/02/2020\nItems: 1\nTotal: 3\nRegards\nABC DATa\nPh:091 : 123456789"
test12  1234567891   www.example.com  hello

Sample 2:

test12  1234567891   www.example.com  hello
test13  1234567892   www.example.com  hi
test14  1234567893   www.example.com  hi

```

I need a command which will work in both cases