Tag Info

New answers tagged

0

If you frequently reorder the columns, you could do something like: tbl = {{"colNbr", "ColStr", "ColDate"}, {1, "1", "1/11/11"}, {2, "2", "2/12/12"}}; fNbr[n_] := n^2 fStr[s_] := s <> "joined" fDate[d_] := dodate[d] hdrs = {"ColDate", "colNbr", "ColStr"}; funcs = {fDate, fNbr, fStr}; funcsReordered = First /@ Extract[funcs, Position[hdrs, #] & /@ ...


2

Since v9 (if I recall) you can use MapAt with Span for such things: sample = {{"Sample", "Data", "creationdate", "othervariable"}, {2.3, 4.3, "20141008125809", 8.4}, {3.2, 1.3, "20141008125809", 9.2}, {3.2, 1.3, "20141008125809", 11.84}}; MapAt[fixDate, sample, {2 ;;, 3}] {{"Sample", "Data", "creationdate", "othervariable"}, {2.3, 4.3, ...



Top 50 recent answers are included