if I have a txt file with an item in each line for example, fruits.txt.
apples
oranges
bananas
cherries
How can I use a bash command line/s to convert it into another txt file that has an enumerated id corresponding to a particular fruit, to say fruitids.txt.
item {
id: 1
name: 'apples'
}
item {
id: 2
name: 'oranges'
}
item {
id: 3
name: 'bananas'
}
item {
id: 4
name: 'cherries'
}